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:
When your opponent adds a card(s) from their Deck to their hand, including drawing: They must discard 1 of those cards.
--強烈なはたき落とし --Drastic Drop Off local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_HANDES) e1:SetCode(EVENT_TO_HAND) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,1-tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1) end function s.filter(c,e,tp) return c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local sg=eg:Filter(s.filter,nil,e,1-tp) if #sg==0 then elseif #sg==1 then Duel.SendtoGrave(sg,REASON_EFFECT|REASON_DISCARD) else Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD) local dg=sg:Select(1-tp,1,1,nil) Duel.SendtoGrave(dg,REASON_EFFECT|REASON_DISCARD) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Ancient Gear" monster you control; destroy it, and if you do, inflict damage to your opponent equal to half its original ATK.
--古代の機械爆弾 --Ancient Gear Explosive 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_ANCIENT_GEAR} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_ANCIENT_GEAR) 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_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then if Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,tc:GetBaseAttack()/2,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Add up to 3 face-up "Qli" Pendulum Monster Cards from your Extra Deck to your hand. You can only activate 1 "Qlimate Change" per turn.
--隠されし機殻 --Qlimate Change 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:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_QLI} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_QLI) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,3,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:
Select 1 monster with a Venom Counter(s). Remove all Venom Counters from that card, and inflict 700 damage to your opponent for each Venom Counter removed.
--ヴェノム・スプラッシュ --Venom Burn local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.counter_list={COUNTER_VENOM} function s.filter(c) return c:GetCounter(COUNTER_VENOM)>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) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetCounter(COUNTER_VENOM)*700) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local ct=tc:GetCounter(COUNTER_VENOM) if ct>0 then tc:RemoveCounter(tp,COUNTER_VENOM,ct,REASON_EFFECT) Duel.Damage(1-tp,ct*700,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a monster(s) you control or in your hand is destroyed by battle or card effect: You can Special Summon this card from your hand. If this card in its owner's possession is destroyed by an opponent's card: You can target 1 other Dinosaur monster and/or 1 Rock monster in your GY; Special Summon them. You can only use each effect of "Bayerock Dragon" once per turn.
--岩竜ベアロック --Bayerock Dragon --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcond) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special Summon 1 Dinosaur and/or Rock monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end function s.filter(c,tp) return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousControler(tp) and ((c:IsPreviousLocation(LOCATION_HAND) and c:IsMonster()) or c:IsPreviousLocation(LOCATION_MZONE)) end function s.spcond(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) 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.spcon2(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and e:GetHandler():IsPreviousControler(tp) end function s.spfilter(c,e,tp) return c:IsRace(RACE_DINOSAUR|RACE_ROCK) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.rescon(sg,e,tp) return sg:GetClassCount(Card.GetRace)==#sg end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) and chkc~=c end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=math.min(ft,1) end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,c,e,tp) if chk==0 then return ft>0 and #g>0 and aux.SelectUnselectGroup(g,e,tp,1,math.min(ft,2),aux.dpcheck(Card.GetRace),0) end local sg=aux.SelectUnselectGroup(g,e,tp,1,math.min(ft,2),aux.dpcheck(Card.GetRace),1,tp,HINTMSG_SPSUMMON) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,#sg,tp,0) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local sg=Duel.GetTargetCards(e) if #sg==0 or ft==0 then return end if #sg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if #sg>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) sg=sg:Select(tp,ft,ft,nil) end Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can look at the top 3 cards of your opponent's Deck, and if you do, place them on top of their Deck in any order. (Quick Effect): You can Tribute this card, then target 1 "SPYRAL" monster you control; it gains 500 ATK for each card your opponent controls. You can banish this card and 1 "SPYRAL" card from your GY, then target 1 "SPYRAL Super Agent" in your GY; add it to your hand.
--SPYRAL GEAR-ドローン --SPYRAL GEAR - Drone local s,id=GetID() function s.initial_effect(c) --sort local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sttg) e1:SetOperation(s.stop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --atkup local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(TIMING_DAMAGE_STEP) e3:SetCondition(aux.StatChangeDamageStepCondition) e3:SetCost(Cost.SelfTribute) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) --to hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_GRAVE) e4:SetCost(s.thcost) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) end s.listed_series={SET_SPYRAL} s.listed_names={41091257} function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end end function s.stop(e,tp,eg,ep,ev,re,r,rp) Duel.SortDecktop(tp,1-tp,3) end function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(SET_SPYRAL) 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.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 and Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local atk=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)*500 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(atk) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end function s.cfilter(c,tp) return c:IsSetCard(SET_SPYRAL) and c:IsAbleToRemoveAsCost() and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) end function s.thfilter(c) return c:IsCode(41091257) and c:IsAbleToHand() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,c,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,c,tp) g:AddCard(c) Duel.Remove(g,POS_FACEUP,REASON_COST) 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 true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) 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:
2 Cyberse monsters If this card is Link Summoned: You can add 1 "Cynet Fusion" from your Deck to your hand. If a monster(s) is Special Summoned to a zone(s) this card points to (except during the Damage Step): You can target 1 Level 4 or lower Cyberse monster in your GY; Special Summon it, but negate its effects, also you cannot Special Summon monsters from the Extra Deck for the rest of this turn, except Fusion Monsters. You can only use each effect of "Clock Spartoi" once per turn.
--クロック・スパルトイ --Clock Spartoi --scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,2) c:EnableReviveLimit() --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_LEAVE_GRAVE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) e2:SetCondition(aux.zptcon(nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={65801012} function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) end function s.thfilter(c) return c:IsCode(65801012) and c:IsAbleToHand() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLinkSummoned() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.spfilter(c,e,tp) return c:IsRace(RACE_CYBERSE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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,tp,LOCATION_GRAVE) end 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.SpecialSummonStep(tc,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) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2,true) end Duel.SpecialSummonComplete() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD) ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) ge1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) ge1:SetDescription(aux.Stringid(id,2)) ge1:SetTargetRange(1,0) ge1:SetTarget(s.splimit) ge1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(ge1,tp) --lizard check aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) end function s.lizfilter(e,c) return not c:IsOriginalType(TYPE_FUSION) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Linked monsters you control can make up to 2 attacks on monsters during each Battle Phase. You can only use each of the following effects of "Full Active Duplex" once per turn. You can banish 2 Link Monsters from your GY; Special Summon this card from your hand. If this card is sent to the GY: You can target 1 Cyberse monster you control; it gains 1000 ATK.
--フルアクティブ・デュプレックス --Full Active Duplex --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Linked monsters can make up to 2 attacks on monsters local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsLinked)) e1:SetValue(1) c:RegisterEffect(e1) --Special summon procedure 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:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Increase the ATK of a Cyberse monster by 1000 local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) 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,1}) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end function s.spfilter(c) return c:IsLinkMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) if chk==0 then return #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsRace(RACE_CYBERSE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then tc:UpdateAttack(1000,RESET_EVENT|RESETS_STANDARD,e:GetHandler()) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time your opponent declares a face-up Defense Position monster as an attack target, toss a coin and call it. If you call it right, change the targeted monster to Attack Position. If you call it wrong, the controller of this card takes damage equal to the amount that the ATK of the attacking monster is higher than the DEF of the attack target.
--反撃準備 --Prepare to Strike Back local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START) e1:SetTarget(s.atktg1) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Toss a coin and apply the appropriate effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_COIN) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg2) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.toss_coin=true function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttackTarget() return Duel.IsTurnPlayer(1-tp) and at and at:IsPosition(POS_FACEUP_DEFENSE) end function s.atktg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end e:SetLabel(0) local at=Duel.GetAttackTarget() if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.IsTurnPlayer(1-tp) and at and at:IsPosition(POS_FACEUP_DEFENSE) then e:SetLabel(1) Duel.GetAttacker():CreateEffectRelation(e) at:CreateEffectRelation(e) Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) end end function s.atktg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end e:SetLabel(1) Duel.GetAttacker():CreateEffectRelation(e) Duel.GetAttackTarget():CreateEffectRelation(e) Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end local a=Duel.GetAttacker() local at=Duel.GetAttackTarget() if a:IsFaceup() and a:IsRelateToEffect(e) and at:IsFaceup() and at:IsRelateToEffect(e) then if Duel.CallCoin(tp) then Duel.ChangePosition(at,POS_FACEUP_ATTACK) elseif a:GetAttack()>at:GetDefense() then Duel.Damage(tp,a:GetAttack()-at:GetDefense(),REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] You can pay 1000 LP, then target 1 of your banished Dragon monsters; destroy this card, and if you do, add that monster to your hand. You can only use this effect of "Chaos Emperor, the Dragon of Armageddon" once per turn. ---------------------------------------- [ Monster Effect ] Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or Extra Deck) by banishing 1 LIGHT and 1 DARK monster from your GY. You can only Special Summon "Chaos Emperor, the Dragon of Armageddon" once per turn this way. Once per turn: You can pay half your LP; send as many cards you control as possible to the GY, except from the Extra Monster Zone, and if you do, send cards your opponent controls to the GY, up to the number of your cards sent to the GY, then, inflict 300 damage to your opponent for each card sent to their GY by this card's effect. If this face-up Special Summoned card leaves the field, return it to the bottom of the Deck.
--終焉龍 カオス・エンペラー --Chaos Emperor, the Dragon of Armageddon --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Pendulum.AddProcedure(c) --Add 1 banished Dragon monster to the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.PayLP(1000)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Special Summon condition local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e2) --Special Summon procedure local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_SPSUMMON_PROC) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetCountLimit(1,{id,1},EFFECT_COUNT_CODE_OATH) e3:SetRange(LOCATION_EXTRA|LOCATION_HAND) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) --Send cards to the GY and inflict damage local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCost(s.gycost) e4:SetTarget(s.gytg) e4:SetOperation(s.gyop) c:RegisterEffect(e4) --Send itself to the Deck if it leaves the field local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) e5:SetValue(LOCATION_DECKBOT) c:RegisterEffect(e5) local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetCode(EVENT_SPSUMMON_SUCCESS) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e6:SetOperation(function(e) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) end) c:RegisterEffect(e6) end function s.thfilter(c) return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.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_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.rescon(sg,e,tp,mg) return sg:IsExists(s.atchk1,1,nil,sg) and ((not e:GetHandler():IsLocation(LOCATION_EXTRA) and aux.ChkfMMZ(1)(sg,e,tp,mg)) or (e:GetHandler():IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,sg,e:GetHandler())>0)) end function s.atchk1(c,sg) return c:IsAttribute(ATTRIBUTE_LIGHT) and sg:FilterCount(Card.IsAttribute,c,ATTRIBUTE_DARK)==1 end function s.spfilter(c,att) return c:IsAttribute(att) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg1=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT) local rg2=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,ATTRIBUTE_DARK) local rg=rg1:Clone() rg:Merge(rg2) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg1>0 and #rg2>0 and aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) local g=aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,1,tp,HINTMSG_REMOVE,nil,nil,true) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true else return false end end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() Duel.Remove(g,POS_FACEUP,REASON_COST) g:DeleteGroup() end function s.gycost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) end function s.sgfilter(c,p) return c:IsLocation(LOCATION_GRAVE) and c:IsControler(p) end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(nil,tp,LOCATION_SZONE|LOCATION_MMZONE,0,nil) local og=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) if chk==0 then return #g>0 and #og>0 end local oc=#og g:Merge(og) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,oc*300) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(nil,tp,LOCATION_SZONE|LOCATION_MMZONE,0,nil) if #g==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 then return end local oc=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) if oc==0 then return end local dc=Duel.GetOperatedGroup():FilterCount(s.sgfilter,nil,1-tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local og=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,oc,nil) if Duel.SendtoGrave(og,REASON_EFFECT)>0 then Duel.BreakEffect() dc=dc+Duel.GetOperatedGroup():FilterCount(s.sgfilter,nil,1-tp) Duel.Damage(1-tp,dc*300,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Increase the DEF of all monsters on your side of the field by 300 points.
--カオス・シールド --Yellow Luster Shield 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) --Def up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetValue(300) c:RegisterEffect(e2) 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. When a face-up monster you control is destroyed by a card effect and sent to the GY (except during the Damage Step): You can Special Summon this card from your hand. Once per turn: You can target 1 Synchro Monster your opponent controls; equip that target to this card. Gains ATK/DEF equal to half your LP and ATK equal to the combined ATK of the monsters equipped to it by this effect. You can target 1 of these equipped monsters; Special Summon that target to your field in Defense Position.
--機皇帝グランエル∞ --Meklord Emperor Granel local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --special summon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(0) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --atk,def up local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetValue(s.val) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e4) --equip local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetCategory(CATEGORY_EQUIP) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) e5:SetTarget(s.eqtg) e5:SetOperation(s.eqop) c:RegisterEffect(e5) aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e5) --special summon equip local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,2)) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_IGNITION) e6:SetProperty(EFFECT_FLAG_CARD_TARGET) e6:SetRange(LOCATION_MZONE) e6:SetTarget(s.sptg2) e6:SetOperation(s.spop2) c:RegisterEffect(e6) end function s.eqval(ec,c,tp) return ec:IsControler(1-tp) and ec:IsType(TYPE_SYNCHRO) end function s.filter(c,tp) return c:IsMonster() and (c:GetReason()&(REASON_DESTROY|REASON_EFFECT))==(REASON_DESTROY|REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,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,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 not c:IsRelateToEffect(e) then return end if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then c:CompleteProcedure() end end function s.val(e,c) return Duel.GetLP(c:GetControler())/2 end function s.eqfilter(c) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToChangeControler() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) end function s.equipop(c,e,tp,tc) local atk=tc:GetTextAttack() if atk<0 then atk=0 end if not c:EquipByEffectAndLimitRegister(e,tp,tc,id) then return end if atk>0 then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetReset(RESET_EVENT|RESETS_STANDARD) e2:SetValue(atk) tc:RegisterEffect(e2) end end function s.eqop(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) and tc:IsMonster() then s.equipop(c,e,tp,tc) end end function s.spfilter(c,e,tp,ec) return c:GetFlagEffect(id)~=0 and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp,e:GetHandler()) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc 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:
When an Xyz Monster battles another monster, that Xyz Monster gains 200 ATK & DEF x its Rank, during damage calculation only. If this face-up card on the field would be destroyed by a card effect, you can detach 1 Xyz Material from a monster you control instead.
--エクシーズ・テリトリー --Xyz Territory 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) --ad up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCondition(s.adcon) e2:SetTarget(s.adtg) e2:SetValue(s.adval) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) --Destroy replace local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_DESTROY_REPLACE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_FZONE) e4:SetTarget(s.desreptg) c:RegisterEffect(e4) end function s.adcon(e) return Duel.IsPhase(PHASE_DAMAGE_CAL) and Duel.GetAttackTarget() end function s.adtg(e,c) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return (c==a or c==d) and c:IsType(TYPE_XYZ) end function s.adval(e,c) return c:GetRank()*200 end function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsReason(REASON_REPLACE+REASON_RULE) and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT) end if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT) return true else return false end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Damage Step of either player's turn, when a "Battlin' Boxer" monster you control is attacking or being attacked: You can banish this card from your hand or Graveyard; that monster gains 1000 ATK, until the end of this turn. You can only use the effect of "Battlin' Boxer Counterpunch" once per turn.
--BK カウンターブロー --Battlin' Boxer Counterpunch local s,id=GetID() function s.initial_effect(c) --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfBanish) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_BATTLIN_BOXER} function s.condition(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return (a:IsControler(tp) and a:IsSetCard(SET_BATTLIN_BOXER) and a:IsRelateToBattle()) or (d and d:IsControler(tp) and d:IsSetCard(SET_BATTLIN_BOXER) and d:IsRelateToBattle()) end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetAttacker() if Duel.IsTurnPlayer(1-tp) then a=Duel.GetAttackTarget() end if not a:IsRelateToBattle() then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1000) a:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card destroys an opponent's monster by battle: You can target 1 Cyberse monster with 1500 or less ATK in your GY; Special Summon it.
--リビルディア --Rebuildeer --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(aux.bdocon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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:
Special Summon 1 "Dragon Ruler" monster from your hand, GY, or banishment, then immediately after this effect resolves, you can Xyz Summon 1 "Dragon Ruler" Xyz Monster using only "Dragon Ruler" monsters you control. During your Main Phase: You can banish this card from your GY, then target any number of your banished "Dragon Ruler" monsters with different Attributes; return them to the GY. You can only use 1 "Here There Be Dragons" effect per turn, and only once that turn.
--超竜災禍 --Here There Be Dragons --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Dragon Ruler" monster from your hand, GY, or banishment then you can Xyz Summon 1 "Dragon Ruler" monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Return any number of your banished "Dragon Ruler" monsters with different Attributes to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_series={SET_DRAGON_RULER} function s.spfilter(c,e,tp) return c:IsSetCard(SET_DRAGON_RULER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.xyzfilter(c,mg) return c:IsSetCard(SET_DRAGON_RULER) and c:IsXyzSummonable(nil,mg) 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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_DRAGON_RULER),tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() Duel.XyzSummon(tp,sc,nil,mg) end end end function s.tgfilter(c,e) return c:IsSetCard(SET_DRAGON_RULER) and c:IsFaceup() and c:IsMonster() and c:IsCanBeEffectTarget(e) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil,e) if chk==0 then return #g>0 end local tg=aux.SelectUnselectGroup(g,e,tp,1,#g,aux.dpcheck(Card.GetAttribute),1,tp,HINTMSG_RTOGRAVE) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,tp,0) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg>0 then Duel.SendtoGrave(tg,REASON_EFFECT|REASON_RETURN) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Apply 1 of these effects. You must control a "Vaalmonica" Monster Card to activate and to resolve this effect. If you control a "Vaalmonica" Link Monster, you can apply both effects in sequence. ● Gain 500 LP, then you can destroy 1 Spell/Trap on the field. ● Take 500 damage, then you can return 1 monster from the field to the hand. You can only activate 1 "Vaalmonica Followed Rhythm" per turn.
--律導のヴァルモニカ --Vaalmonica Followed Rhythm --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_RECOVER+CATEGORY_DESTROY+CATEGORY_DAMAGE+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_VAALMONICA} function s.cfilter(c) return c:IsSetCard(SET_VAALMONICA) and c:IsFaceup() and c:IsOriginalType(TYPE_MONSTER) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_ONFIELD) Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_EITHER,LOCATION_MZONE) end function s.linkfilter(c) return c:IsSetCard(SET_VAALMONICA) and c:IsFaceup() and c:IsLinkMonster() end function s.activate(e,tp,eg,ep,ev,re,r,rp,angello_or_dimonno) --Additional parameter used by "Angello Vaalmonica" and "Dimonno Vaalmonica" if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then return end local op=nil if angello_or_dimonno then op=angello_or_dimonno else local both=Duel.IsExistingMatchingCard(s.linkfilter,tp,LOCATION_MZONE,0,1,nil) op=Duel.SelectEffect(tp, {true,aux.Stringid(id,1)}, {true,aux.Stringid(id,2)}, {both,aux.Stringid(id,3)}) end local break_chk=nil if op==1 or op==3 then --Gain 500 LP and Destroy 1 Spell/Trap on the field local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) if Duel.Recover(tp,500,REASON_EFFECT)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then break_chk=true Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g:Select(tp,1,1,nil) Duel.HintSelection(dg,true) Duel.BreakEffect() Duel.Destroy(dg,REASON_EFFECT) end end if op==2 or op==3 then --Take 500 damage and return 1 monster on the field to the hand local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if break_chk then Duel.BreakEffect() end if Duel.Damage(tp,500,REASON_EFFECT)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local hg=g:Select(tp,1,1,nil) Duel.HintSelection(hg,true) Duel.BreakEffect() Duel.SendtoHand(hg,nil,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Beast-Type monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent. If you inflict battle damage to your opponent with this effect: Target 1 face-up monster your opponent controls; that target loses 500 ATK and DEF. (This remains even if this card leaves the field.)
--吠え猛る大地 --Roaring Earth 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) --pierce local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_PIERCE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST)) c:RegisterEffect(e2) --atkdown local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetRange(LOCATION_SZONE) e3:SetCondition(s.atkcon) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return d and eg:GetFirst()==a and a:IsControler(tp) and a:IsRace(RACE_BEAST) and d:IsDefensePos() 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(1-tp) and chkc:IsFaceup() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-500) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Amazoness Queen" + 1 "Amazoness" monster Other "Amazoness" cards you control cannot be destroyed by battle or card effects. If your "Amazoness" monster attacks a Defense Position monster, inflict piercing battle damage to your opponent. If this face-up Fusion Summoned card is destroyed by battle, or leaves the field because of an opponent's card effect while its owner controls it: You can Special Summon 1 "Amazoness Queen" from your hand, Deck, or GY.
--アマゾネス女帝 --Amazoness Empress local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,15951532,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_AMAZONESS)) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_ONFIELD,0) e1:SetTarget(s.indtg) e1:SetValue(1) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) --pierce local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_PIERCE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_AMAZONESS)) c:RegisterEffect(e3) --special summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetCondition(s.spcon) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) end s.listed_series={SET_AMAZONESS} s.listed_names={15951532} s.material_setcode=SET_AMAZONESS function s.indtg(e,c) return c:IsSetCard(SET_AMAZONESS) and c~=e:GetHandler() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsFusionSummoned() and (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT))) and c:IsPreviousPosition(POS_FACEUP) end function s.filter(c,e,tp) return c:IsCode(15951532) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) 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,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND|LOCATION_DECK|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:
(This card is always treated as an "Infernity" card.) Special Summon 1 of your "Infernity" monsters that is banished, or in your hand or GY. If a face-up "Infernity" monster(s) you control is destroyed by battle, or leaves the field because of an opponent's card effect, while this card is in your GY: You can Set this card. You can only use each effect of "This Creepy Little Punk" once per turn.
--舞い戻った死神 --This Creepy Little Punk --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,{id,0}) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Set itself from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.setcon) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end s.listed_series={SET_INFERNITY} function s.spfilter(c,e,tp) return c:IsSetCard(SET_INFERNITY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local loc=LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,loc,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local loc=LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,loc,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.setconfilter(c,rp,tp) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(SET_INFERNITY) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and rp==1-tp)) end function s.setcon(e,tp,eg,ep,ev,re,r,rp) return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.setconfilter,1,nil,rp,tp) end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsSSetable() end Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsSSetable() then Duel.SSet(tp,c) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as a "Galaxy-Eyes" card.) Pay half your LP, then target 2 monsters in your GY; Special Summon both, but negate their effects, then, immediately after this effect resolves, Xyz Summon 1 "Number" Xyz Monster using only those 2 monsters, also for the rest of this turn after this card resolves, you can only Special Summon one more time from the Extra Deck. You can only activate 1 "Numbers Last Hope" per turn.
--最後の希望 --Numbers Last Hope --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_GALAXY_EYES,SET_NUMBER} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) end function s.tgfilter(c,e,tp) return c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.xyzfilter(c,mg) return c:IsSetCard(SET_NUMBER) and c:IsXyzSummonable(nil,mg,2,2) end function s.mfilter1(c,mg,exg) return mg:IsExists(s.mfilter2,1,c,c,exg) end function s.mfilter2(c,mc,exg) return exg:IsExists(Card.IsXyzSummonable,1,nil,nil,Group.FromCards(c,mc)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local mg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local exg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg) if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and #exg>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=mg:FilterSelect(tp,s.mfilter1,1,1,nil,mg,exg) local tc1=sg1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=mg:FilterSelect(tp,s.mfilter2,1,1,tc1,tc1,exg) sg1:Merge(sg2) Duel.SetTargetCard(sg1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,3,tp,LOCATION_GRAVE|LOCATION_EXTRA) end function s.filter2(c,e,tp) return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.filter2,nil,e,tp) if #g<2 then return end local c=e:GetHandler() for tc in g:Iter() do if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then --Negate their effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) tc:RegisterEffect(e2) end end if Duel.SpecialSummonComplete()~=2 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local xyz=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,g):GetFirst() if xyz then Duel.XyzSummon(tp,xyz,g,nil,2,2) xyz:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD,0,1) end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end --Check for a Special Summon from the Extra Deck local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCondition(s.spcon) e3:SetOperation(s.spop) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) end function s.cfilter(c,tp) return c:IsSummonPlayer(tp) and c:IsSummonLocation(LOCATION_EXTRA) and c:GetFlagEffect(id)==0 end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --Cannot Special Summon from the Extra Deck local e1=Effect.CreateEffect(c) 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(_,c) return c:IsLocation(LOCATION_EXTRA) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --Clock Lizard check aux.addTempLizardCheck(c,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control another Reptile monster, if a Reptile monster you control attacks a Defense Position monster, inflict piercing battle damage.
--ライオ・アリゲーター --Lion Alligator 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:SetCondition(s.condition) e1:SetTarget(s.target) c:RegisterEffect(e1) end function s.condition(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_REPTILE),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end function s.target(e,c) return c:IsRace(RACE_REPTILE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
A Fiend-Type monster equipped with this card increases its ATK and DEF by 300 points.
--闇・エネルギー --Dark Energy local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND)) --atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(300) c:RegisterEffect(e2) --def up local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetValue(300) c:RegisterEffect(e3) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Valkyrion the Magna Warrior" + "Berserkion the Electromagna Warrior" Must be Fusion Summoned with the above Fusion Materials and cannot be Special Summoned by other ways. Once per turn, during either player's turn, when your opponent activates a Spell/Trap Card, or monster effect: You can negate the activation, and if you do, destroy that card. If this face-up card in its owner's control leaves the field because of an opponent's card effect: You can Special Summon both 1 "Valkyrion the Magna Warrior" and 1 "Berserkion the Electromagna Warrior" from your hand and/or Deck, ignoring their Summoning conditions.
--超電導戦機インペリオン・マグナム --Imperion Magnum the Superconductive Battlebot local s,id=GetID() function s.initial_effect(c) --Fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,false,false,75347539,42901635) --Special Summon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(aux.fuslimit) c:RegisterEffect(e1) --Negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.negcon) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.material_setcode=SET_MAGNA_WARRIOR function s.negcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end return (re:IsMonsterEffect() or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) 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 function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:GetReasonPlayer()==1-tp and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) end function s.spfilter(c,e,tp,code) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp,75347539) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp,42901635) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND|LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g1=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,nil,e,tp,75347539) local g2=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,nil,e,tp,42901635) if #g1>0 and #g2>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=g1:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=g2:Select(tp,1,1,nil) sg1:Merge(sg2) Duel.SpecialSummon(sg1,0,tp,tp,true,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card on the field can be treated as a Level 8 monster when used for a Synchro Summon. A Synchro Monster that used this card as material gains this effect based on its original Level. ● 8 or lower: Gains 800 ATK/DEF. ● 9 or higher: If this card attacks a Defense Position monster, inflict piercing battle damage.
--ヤマタコオロチ --Yamatako Orochi --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Can be treated as Level 8 for a Synchro Summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SYNCHRO_LEVEL) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_ONFIELD) e1:SetValue(function(e) return 8*65536+e:GetHandler():GetLevel() end) c:RegisterEffect(e1) --Synchro Monster gains effect 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.effcon) e2:SetOperation(s.effop) c:RegisterEffect(e2) end function s.effcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():HasLevel() end function s.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() if rc:GetOriginalLevel()<=8 then --Gain 800 ATK/DEF local e1=Effect.CreateEffect(rc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(800) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) rc:RegisterEffect(e2) else --Inflict piercing damage local e1=Effect.CreateEffect(rc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_PIERCE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1) end if not rc:IsType(TYPE_EFFECT) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_ADD_TYPE) e3:SetValue(TYPE_EFFECT) e3:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e3,true) end rc:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 monster to activate this card. All face-up monsters on the field that you own are unaffected by other Trap Cards.
--暴君の威圧 --Tyrant's Temper 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:SetCost(s.cost) c:RegisterEffect(e1) --immune local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.etarget) e2:SetValue(s.efilter) c:RegisterEffect(e2) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,aux.TRUE,1,false,nil,nil,tp) end local g=Duel.SelectReleaseGroupCost(tp,aux.TRUE,1,1,false,nil,nil,tp) Duel.Release(g,REASON_COST) end function s.etarget(e,c) return c:GetOwner()==e:GetHandlerPlayer() end function s.efilter(e,te) return te:IsTrapEffect() and te:GetOwner()~=e:GetOwner() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control no cards, you can Special Summon this card (from your hand). A "Utopia" Xyz Monster that was Summoned using this card on the field as material gains this effect. ● If this card is Xyz Summoned: You can add 1 "Rank-Up-Magic" Normal Spell from your Deck to your hand. You can only use this effect of "ZS - Ascended Sage" once per turn.
--ZS-昇華賢者 --ZS - Ascended Sage --Logical Nonsense --Substitute ID 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: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) --Grant effect to "Utopia "Xyz monster using this card as material local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e2:SetCountLimit(1,id) e2:SetCondition(s.efcon) e2:SetOperation(s.efop) c:RegisterEffect(e2) end --Lists "Utopia" and "Rank-Up-Magic" archetypes s.listed_series={SET_UTOPIA,SET_RANK_UP_MAGIC} --If you control no cards function s.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_ONFIELD,0)==0 end --If an "Utopia" Xyz used this card as material function s.efcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return r==REASON_XYZ and c:GetReasonCard():IsSetCard(SET_UTOPIA) end --Grant effect to "Utopia "Xyz monster using this card as material function s.efop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() local e1=Effect.CreateEffect(rc) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(s.xyzcon) e1:SetTarget(s.xyztg) e1:SetOperation(s.xyzop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1,true) if not rc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e2,true) end end --If Xyz summoned function s.xyzcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() end --Check for "Rank-Up-Magic" normal spell function s.filter(c) return c:IsSetCard(SET_RANK_UP_MAGIC) and c:IsNormalSpell() and c:IsAbleToHand() end --Activation legality function s.xyztg(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 --Add 1 "Rank-Up-Magic" normal spell from deck function s.xyzop(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 an "Abyss Script" Spell Card, or its effect, was activated this turn: Add face-up "Abyss Actor" Pendulum Monsters from your Extra Deck to your hand, up to the number of "Abyss Script" Spells in your GY. Then, you can Special Summon "Abyss Actor" Pendulum Monsters from your hand with different names, up to the number of monsters added to the hand by this effect. You cannot Special Summon monsters for the rest of this turn, except "Abyss Actor" Pendulum Monsters. You can only activate 1 "Abyss Actors' Curtain Call" per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--魔界劇団のカーテンコール --Abyss Actors' Curtain Call --Scripted by Eerie Code 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:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --activity check Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) end s.listed_series={SET_ABYSS_SCRIPT,SET_ABYSS_ACTOR} function s.chainfilter(re,tp,cid) return not (re:IsSpellEffect() and re:GetHandler():IsSetCard(SET_ABYSS_SCRIPT)) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>0 end function s.thfilter(c) return c:IsFaceup() and c:IsSetCard(SET_ABYSS_ACTOR) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand() end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ABYSS_ACTOR) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.ctfilter(c) return c:IsSpell() and c:IsSetCard(SET_ABYSS_SCRIPT) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.ctfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,1)) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_GRAVE,0,nil) if ct<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local hg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,ct,nil) if #hg>0 and Duel.SendtoHand(hg,nil,REASON_EFFECT)~=0 then local sct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,tp) local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp) local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),sct) if sct>0 and ft>0 and #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local g=aux.SelectUnselectGroup(sg,e,tp,1,ft,aux.dncheck,1,tp,HINTMSG_SPSUMMON,false) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end function s.splimit(e,c) return not (c:IsSetCard(SET_ABYSS_ACTOR) and c:IsType(TYPE_PENDULUM)) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Metalfoes" monster + 1 Pendulum Monster You can target 2 "Metalfoes" cards in your GY and 1 card on the field; shuffle the targets from your GY into the Deck, and if you do, return the target on the field to the hand. You can only use this effect of "Metalfoes Mithrilium" once per turn. If this card is sent from the field to the GY: You can Special Summon 1 "Metalfoes" Pendulum Monster from your GY or face-up Extra Deck.
--メタルフォーゼ・ミスリエル --Metalfoes Mithrilium local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_METALFOES),aux.FilterBoolFunctionEx(Card.IsType,TYPE_PENDULUM)) --return local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) 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:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_METALFOES} s.material_setcode=SET_METALFOES function s.retfilter1(c) return c:IsSetCard(SET_METALFOES) and c:IsAbleToDeck() end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.retfilter1,tp,LOCATION_GRAVE,0,2,nil) and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g1=Duel.SelectTarget(tp,s.retfilter1,tp,LOCATION_GRAVE,0,2,2,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,#g1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g2,1,0,0) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) local g1=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE) if Duel.SendtoDeck(g1,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 then local og=Duel.GetOperatedGroup() if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end local g2=g:Filter(Card.IsLocation,nil,LOCATION_ONFIELD) Duel.SendtoHand(g2,nil,REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.spfilter(c,e,tp) if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)==0 then return false end return c:IsSetCard(SET_METALFOES) and c:IsType(TYPE_PENDULUM) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local loc=LOCATION_EXTRA if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc|LOCATION_GRAVE end if chk==0 then return loc~=0 and Duel.IsExistingMatchingCard(s.spfilter,tp,loc,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local loc=LOCATION_EXTRA if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc|LOCATION_GRAVE end if loc==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,loc,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: Place 1 Guard Counter on it. This card gains 300 ATK for each Guard Counter on it. Once per turn: You can target 1 other face-up card you control; remove 1 Guard Counter from this card, and if you do, place 1 Guard Counter on that target (if that card would ever be destroyed, remove 1 Guard Counter from it instead).
--カードガード --Card Guard local s,id=GetID() function s.initial_effect(c) --summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.addct) e1:SetOperation(s.addc) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --attackup local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetValue(s.attackup) c:RegisterEffect(e3) --destroy rep local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_COUNTER) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetCountLimit(1) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetTarget(s.addct2) e4:SetOperation(s.addc2) c:RegisterEffect(e4) end s.counter_place_list={0x1021} function s.addct(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x1021) end function s.addc(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then e:GetHandler():AddCounter(0x1021+COUNTER_NEED_ENABLE,1) end end function s.attackup(e,c) return c:GetCounter(0x1021)*300 end function s.addct2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() end if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1021,1,REASON_EFFECT) and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()) end function s.addc2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:GetCounter(0x1021)==0 then return end c:RemoveCounter(tp,0x1021,1,REASON_EFFECT) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then tc:AddCounter(0x1021,1) if tc:GetFlagEffect(id)~=0 then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetTarget(s.reptg) e1:SetOperation(s.repop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) end end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsReason(REASON_REPLACE+REASON_RULE) and e:GetHandler():GetCounter(0x1021)>0 end return true end function s.repop(e,tp,eg,ep,ev,re,r,rp,chk) e:GetHandler():RemoveCounter(tp,0x1021,1,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 "World Chalice" monsters Gains 300 ATK for each "World Legacy" monster in your GY with a different name. You can Tribute 1 "World Chalice" monster this card points to, then target 1 other monster in your GY; Special Summon it to your zone this card points to. You can only use this effect of "Auram the World Chalice Blademaster" once per turn. If this card is sent from the field to the GY: You can Special Summon 1 "World Chalice" monster from your hand.
--星杯剣士アウラム --Auram the World Chalice Blademaster local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_WORLD_CHALICE),2,2) c:EnableReviveLimit() --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) --spsummon 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(s.spcost1) e2:SetTarget(s.sptg1) e2:SetOperation(s.spop1) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.spcon2) e3:SetTarget(s.sptg2) e3:SetOperation(s.spop2) c:RegisterEffect(e3) end s.listed_series={SET_WORLD_LEGACY,SET_WORLD_CHALICE} function s.atkfilter(c) return c:IsMonster() and c:IsSetCard(SET_WORLD_LEGACY) end function s.atkval(e,c) return Duel.GetMatchingGroup(s.atkfilter,c:GetControler(),LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)*300 end function s.cfilter(c,g,tp,zone) return c:IsSetCard(SET_WORLD_CHALICE) and g:IsContains(c) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_TOFIELD,zone)>0 end function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) local lg=e:GetHandler():GetLinkedGroup() local zone=e:GetHandler():GetLinkedZone(tp) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,lg,tp,zone) end local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,lg,tp,zone) Duel.Release(g,REASON_COST) e:SetLabelObject(g:GetFirst()) end function s.spfilter1(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local cc=e:GetLabelObject() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=cc and s.spfilter1(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,cc,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,cc,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone(tp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone) end 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:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by having 5 or more LIGHT monsters with different names in your Graveyard, and cannot be Special Summoned by other ways. Once per turn, during either player's turn, when a Spell/Trap Card is activated: You can banish 1 Warrior-Type monster from your Graveyard; negate the activation, and if you do, destroy it. All face-up monsters you control must be Warrior-Type to activate and to resolve this effect.
--ライトレイ ギア・フリード --Lightray Gearfried 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) --spsummon limit local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCode(EVENT_CHAINING) e3:SetCondition(s.negcon) e3:SetCost(s.negcost) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) c:RegisterEffect(e3) aux.DoubleSnareValidity(c,LOCATION_MZONE) 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:IsFaceup() and not c:IsRace(RACE_WARRIOR) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.cfilter2(c) return c:IsRace(RACE_WARRIOR) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter2,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) 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():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.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) or not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_WARRIOR),tp,LOCATION_MZONE,0,1,nil) then return end 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:
1 "Appliancer" monster Cannot be used as Link Material the turn it is Link Summoned. You can Tribute this co-linked card; Special Summon 1 "Appliancer" Link Monster from your GY, except "Appliancer Kappa Scale". You can Tribute this card that is not co-linked; Special Summon 1 Level 4 or lower "Appliancer" monster from your GY. You can only use each effect of "Appliancer Kappa Scale" once per turn.
--計量機塊カッパスケール --Appliancer Kappa Scale --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) --Special Summon if co-linked local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) e2:SetLabel(1) c:RegisterEffect(e2) --Special Summon if not co-linked local e3=e2:Clone() e3:SetDescription(aux.Stringid(id,0)) e3:SetCountLimit(1,{id,1}) e3:SetCondition(aux.NOT(s.spcon)) e3:SetLabel(0) c:RegisterEffect(e3) end s.listed_series={SET_APPLIANCER} s.listed_names={id} function s.lkcon(e) local c=e:GetHandler() return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsLinkSummoned() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetMutualLinkedGroupCount()>0 end function s.spfilter(c,e,tp,colinked) return c:IsSetCard(SET_APPLIANCER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and not c:IsCode(id) and ((c:IsType(TYPE_LINK) and colinked) or (c:IsLevelBelow(4) and not colinked)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local colinked=false if e:GetLabel()==1 then colinked=true end if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,colinked) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local colinked=false if e:GetLabel()==1 then colinked=true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,colinked) 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:
2+ monsters, including a Fiend monster During the Main Phase (Quick Effect): You can discard 1 card, then activate 1 of these effects; ● Destroy 1 card on the field. ● Banish this card (until the End Phase), and if you do, Special Summon 1 LIGHT or DARK monster from your GY. During your Standby Phase: You can draw cards equal to the number of different Monster Types in your GY, then place cards from your hand on the bottom of the Deck in any order, equal to the number of cards you drew. You can only use each effect of "A Bao A Qu, the Lightless Shadow" once per turn.
--光なき影 ア=バオ・ア・クゥー --A Bao A Qu, the Lightless Shadow --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 2+ monsters, including a Fiend monster Link.AddProcedure(c,nil,2,4,s.matcheck) --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,0}) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetCost(s.effcost) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) --Draw cards equal to the number of different Monster Types among the monsters in your GY, then place the same number of cards from your hand on the bottom of the Deck in any order local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) end function s.matcheck(g,lc,sumtype,tp) return g:IsExists(Card.IsRace,1,nil,RACE_FIEND,lc,sumtype,tp) end function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.spfilter(c,e,tp) return c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local b1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0 local b2=c:IsAbleToRemove() and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,2)}, {b2,aux.Stringid(id,3)}) e:SetLabel(op) if op==1 then e:SetCategory(CATEGORY_DESTROY) local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) elseif op==2 then e:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then --Destroy 1 card on the field Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end elseif op==2 then --Banish this card (until the End Phase), and if you do, Special Summon 1 LIGHT or DARK monster from your GY local c=e:GetHandler() if c:IsRelateToEffect(e) and aux.RemoveUntil(c,nil,REASON_EFFECT,PHASE_END,id,e,tp,aux.DefaultFieldReturnOp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetRace) if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,tp,LOCATION_HAND) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetRace) local ct=Duel.Draw(p,d,REASON_EFFECT) if ct==0 then return end Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,ct,ct,nil) if #g==0 then return end Duel.BreakEffect() if Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then Duel.SortDeckbottom(tp,tp,#g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Special Summoned from the Graveyard: Draw 1 card.
--灼熱ゾンビ --Molten Zombie local s,id=GetID() function s.initial_effect(c) --draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_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():GetPreviousLocation()==LOCATION_GRAVE end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,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 you control a Level 4 or lower EARTH Rock monster: You can target 1 Level 4 or lower "Magnet Warrior" monster in your GY; Special Summon it. You can only use this effect of "Magnetic Field" once per turn. Once per turn, at the end of the Damage Step, when an EARTH Rock monster you control battled an opponent's monster, but the opponent's monster was not destroyed by the battle: You can return that opponent's monster to the hand.
--マグネット・フィールド --Magnetic Field 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Return to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DAMAGE_STEP_END) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1) e3:SetCondition(s.atcon) e3:SetOperation(s.atop) c:RegisterEffect(e3) end s.listed_series={SET_MAGNET_WARRIOR} function s.cfilter(c) return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_ROCK) and c:IsAttribute(ATTRIBUTE_EARTH) 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_MAGNET_WARRIOR) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>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) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function s.atcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if not d then return end if d:IsControler(tp) then e:SetLabelObject(a) return d:IsRace(RACE_ROCK) and d:IsAttribute(ATTRIBUTE_EARTH) and d:IsFaceup() and a:IsRelateToBattle() and a:IsLocation(LOCATION_ONFIELD) elseif a:IsControler(tp) then e:SetLabelObject(d) return a:IsRace(RACE_ROCK) and a:IsAttribute(ATTRIBUTE_EARTH) and a:IsFaceup() and d:IsRelateToBattle() and d:IsLocation(LOCATION_ONFIELD) end return false end function s.atop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=e:GetLabelObject() if tc and tc:IsRelateToBattle() then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While "Umi" is not on the field, this card gains 700 ATK, also it cannot attack directly. While "Umi" is on the field: You can target 1 face-up non-WATER monster on the field; destroy it. You can only use this effect of "Amphibious Bugroth MK-11" once per turn.
--水陸両用バグロス Mk-11 --Amphibious Bugroth MK-11 --Logical Nonsense local s,id=GetID() function s.initial_effect(c) --Cannot attack directly if "Umi" isn't active local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetCondition(aux.NOT(s.umicon)) c:RegisterEffect(e1) --Gains 700 ATK if "Umi" isn't active local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(700) c:RegisterEffect(e2) --Destroy 1 non-WATER monster on the field local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCondition(s.umicon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_names={CARD_UMI} function s.umicon(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_UMI),0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsEnvironment(CARD_UMI) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsAttributeExcept(ATTRIBUTE_WATER) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttributeExcept,ATTRIBUTE_WATER),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAttributeExcept,ATTRIBUTE_WATER),tp,LOCATION_MZONE,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:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish 1 "lswarm" monster from your GY, then target 1 "lswarm" monster in your GY; add it to your hand. If the previous effect was activated this turn (and was not negated): You can activate this effect; Immediately after this effect resolves, Normal Summon 1 "lswarm" monster. While this card is in the GY, if it was sent there this turn, you can Normal Summon 1 "lswarm" monster for 1 less Tribute. You can only use each effect of "Evilswarm Kerykeion" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--ヴェルズ・ケルキオン --Evilswarm Kerykeion local s,id=GetID() function s.initial_effect(c) --salvage local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.sumcon) e2:SetTarget(s.sumtg) e2:SetOperation(s.sumop) c:RegisterEffect(e2) --decrease tribute local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_TO_GRAVE) e3:SetOperation(s.decop) c:RegisterEffect(e3) end s.listed_series={SET_LSWARM} function s.rmfilter(c,tp) return c:IsSetCard(SET_LSWARM) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,c) end function s.filter(c) return c:IsSetCard(SET_LSWARM) and c:IsMonster() and c:IsAbleToHand() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) Duel.Remove(g,POS_FACEUP,REASON_COST) 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.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) 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.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end if c:IsRelateToEffect(e) and c:IsFaceup() then c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end function s.sumcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)~=0 end function s.sumfilter(c) return c:IsSetCard(SET_LSWARM) and c:IsSummonable(true,nil) end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil) local tc=g:GetFirst() if tc then Duel.Summon(tp,tc,true,nil) end end function s.decop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetFlagEffect(tp,id+1)~=0 then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DECREASE_TRIBUTE) e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e1:SetTarget(s.rfilter) e1:SetCondition(s.econ) e1:SetCountLimit(1) e1:SetValue(0x1) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(id) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE|PHASE_END,0,1) end function s.econ(e) return #{Duel.GetPlayerEffect(e:GetHandlerPlayer(),id)}~=0 end function s.rfilter(e,c) return c:IsSetCard(SET_LSWARM) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned or Set. Must be Special Summoned by "Yubel", and cannot be Special Summoned by other ways. This card cannot be destroyed by battle. You take no Battle Damage from battles involving this card. Before damage calculation, when this face-up Attack Position card is attacked by an opponent's monster: Inflict damage to your opponent equal to that monster's ATK. During your End Phase: Destroy all other monsters on the field. When this face-up card leaves the field: You can Special Summon 1 "Yubel - The Ultimate Nightmare" from your hand, Deck, or Graveyard.
--ユベル-Das Abscheulich Ritter --Yubel - Terror Incarnate local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) c:RegisterEffect(e1) --You take no battle damage from battles involving this cards local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e2:SetValue(1) c:RegisterEffect(e2) --Inflict damage to the opponent equal to the ATK of the monster that attacks this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_BATTLE_CONFIRM) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCondition(s.damcon) e3:SetTarget(s.damtg) e3:SetOperation(s.damop) c:RegisterEffect(e3) --Destroy all other monsters on the field local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCountLimit(1) e4:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) --Special Summon "Yubel - The Ultimate Nightmare" 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_LEAVE_FIELD) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e5:SetCondition(s.spcon) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) --Cannot be Special Summoned local e6=Effect.CreateEffect(c) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e6) end s.listed_names={CARD_YUBEL,31764700} --Yubel - The Ultimate Nightmare local LOCATION_HAND_DECK_GRAVE=LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE function s.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler()==Duel.GetAttackTarget() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAttackPos() end Duel.SetTargetPlayer(1-tp) local atk=Duel.GetAttacker():GetAttack() Duel.SetTargetParam(atk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) Duel.Destroy(g,REASON_EFFECT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and c:GetLocation()~=LOCATION_DECK end function s.spfilter(c,e,tp) return c:IsCode(31764700) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND_DECK_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND_DECK_GRAVE) 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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND_DECK_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner LIGHT monsters Once per turn: You can pay 1000 LP, then target 1 card on the field; banish that target. When this card is destroyed: You can target any number of other "Lightsworn" monsters in your Graveyard; shuffle them into the Deck, and if you do, you gain 300 LP for each returned card. Once per turn, during your End Phase: Send the top 3 cards of your Deck to the Graveyard.
--ライトロード・アーク ミカエル --Michael, the Arch-Lightsworn local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsAttribute,ATTRIBUTE_LIGHT),1,99) c:EnableReviveLimit() --remove 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:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.PayLP(1000)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --todeck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_DESTROYED) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) c:RegisterEffect(e2) --discard deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCategory(CATEGORY_DECKDES) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.discon) e3:SetTarget(s.distg) e3:SetOperation(s.disop) c:RegisterEffect(e3) end s.listed_series={SET_LIGHTSWORN} function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.filter(c) return c:IsSetCard(SET_LIGHTSWORN) and c:IsMonster() and c:IsAbleToDeck() end function s.rettg(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,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,99,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,#g*300) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) local ct=Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) if ct>0 then Duel.Recover(tp,ct*300,REASON_EFFECT) end end function s.discon(e,tp,eg,ep,ev,re,r,rp) return tp==Duel.GetTurnPlayer() end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.DiscardDeck(tp,3,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can target 1 "Superheavy Samurai" monster you control; equip this monster from your hand or your side of the field to that target. Its Level becomes 5. During either player's turn: You can discard this card, then target 1 Defense Position "Superheavy Samurai" monster you control; until the end of this turn, it loses 800 DEF, but cannot be destroyed by battle or by card effects.
--超重武者装留ファイヤー・アーマー --Superheavy Samurai Soulfire Suit local s,id=GetID() function s.initial_effect(c) --Equip this monster to 1 "Superheavy Samurai" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_HAND|LOCATION_MZONE) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --Targeted "Superheavy Samurai" monster loses 800 DEF, also cannot be destroyed by battle or card effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DEFCHANGE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_HAND) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCondition(function() return not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end) e2:SetCost(Cost.SelfDiscard) e2:SetTarget(s.deftg) e2:SetOperation(s.defop) c:RegisterEffect(e2) end s.listed_series={SET_SUPERHEAVY_SAMURAI} function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(SET_SUPERHEAVY_SAMURAI) and chkc:IsFaceup() and chkc~=c end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_SUPERHEAVY_SAMURAI),tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_SUPERHEAVY_SAMURAI),tp,LOCATION_MZONE,0,1,1,c) Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and Duel.Equip(tp,c,tc) then --Equip limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetValue(function(e,c) return c:IsSetCard(SET_SUPERHEAVY_SAMURAI) end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) --Its Level becomes 5 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_CHANGE_LEVEL) e2:SetValue(5) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) else Duel.SendtoGrave(c,REASON_RULE) end end function s.deffilter(c) return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsSetCard(SET_SUPERHEAVY_SAMURAI) end function s.deftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.deffilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.deffilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) Duel.SelectTarget(tp,s.deffilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.defop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then --It loses 800 DEF local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_DEFENSE) e1:SetValue(-800) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) --Cannot be destroyed by battle or card effects local e2=e1:Clone() e2:SetDescription(3008) e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(1) tc:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) tc:RegisterEffect(e3) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Gazelle the King of Mythical Beasts" + "Berfomet" (This card is always treated as a "Phantom Beast" card.) When this card is destroyed: You can target 1 "Berfomet" or 1 "Gazelle the King of Mythical Beasts" in your GY; Special Summon that target.
--有翼幻獣キマイラ --Chimera the Flying Mythical Beast local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,5818798,77207191) --Special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_DESTROYED) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.material_setcode=SET_PHANTOM_BEAST function s.spfilter(c,e,tp) return c:IsCode(5818798,77207191) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During either player's turn, when a card or effect is activated that would inflict damage to you: You can activate this effect; you cannot Special Summon monsters for the rest of this turn, except "Performage" monsters, also Special Summon this card from your hand, and if you do, make that effect damage to you 0. If Summoned this way, banish it when it leaves the field. If this card is Normal or Special Summoned: Each player takes 500 damage.
--Emフレイム・イーター --Performage Flame Eater local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_HAND) e1:SetCondition(aux.damcon1) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --If normal or special summoned, inflict 500 to both players local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_series={SET_PERFORMAGE} function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID) --Reduce effect damage to 0 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetLabel(cid) e1:SetValue(s.damval) e1:SetReset(RESET_CHAIN) Duel.RegisterEffect(e1,tp) --Banish it if it leaves the field local e2=Effect.CreateEffect(c) e2:SetDescription(3300) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e2:SetReset(RESET_EVENT|RESETS_REDIRECT) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2,true) end local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e3:SetDescription(aux.Stringid(id,2)) e3:SetTargetRange(1,0) e3:SetTarget(s.splimit) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) end function s.damval(e,re,val,r,rp,rc) local cc=Duel.GetCurrentChain() if cc==0 or (r&REASON_EFFECT)==0 then return val end local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID) if cid~=e:GetLabel() then return val end return 0 end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(SET_PERFORMAGE) 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,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,500,REASON_EFFECT,true) Duel.Damage(tp,500,REASON_EFFECT,true) Duel.RDComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your "Ancient Warriors" monster battles, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step. You can only use 1 of the following effects of "Ancient Warriors Saga - Defense of Changban" per turn, and only once that turn. ● At the start of your opponent's Battle Phase: You can send this face-up card from your Spell & Trap Zone to the GY; monsters your opponent controls cannot target "Ancient Warriors" monsters for attacks this turn. ● When an opponent's monster declares an attack: You can banish this card from your GY; Special Summon 1 "Ancient Warriors" monster from your Deck.
--戦華史略-長坂之雄 --Ancient Warriors Saga - Defense of Changban --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetHintTiming(0,TIMING_BATTLE_START) c:RegisterEffect(e0) --If your "Ancient Warriors" monster battles, your opponent cannot activate Spells/Traps until the end of the Damage Step local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetRange(LOCATION_SZONE) e1:SetTargetRange(0,1) e1:SetCondition(s.cannotactcon) e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) end) c:RegisterEffect(e1) --Make monsters your opponent controls unable to target "Ancient Warriors" monsters for attacks this turn 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_SZONE) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMING_BATTLE_START) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.IsPhase(PHASE_BATTLE_START) and not Duel.HasFlagEffect(tp,id) end) e2:SetCost(s.cannotatkcost) e2:SetOperation(s.cannotatkop) c:RegisterEffect(e2) --Special Summon 1 "Ancient Warriors" monster from your Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id) e3:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_ANCIENT_WARRIORS} function s.cannotactcon(e) local bc=Duel.GetBattleMonster(e:GetHandlerPlayer()) return bc and bc:IsSetCard(SET_ANCIENT_WARRIORS) and bc:IsFaceup() end function s.cannotatkcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end Duel.SendtoGrave(c,REASON_COST) end function s.cannotatkop(e,tp,eg,ep,ev,re,r,rp) if Duel.HasFlagEffect(tp,id) then return end Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) local c=e:GetHandler() --Monsters your opponent controls cannot target "Ancient Warriors" monsters for attacks this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetValue(function(e,c) return c:IsSetCard(SET_ANCIENT_WARRIORS) and c:IsFaceup() end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) Auxiliary.RegisterClientHint(c,nil,tp,0,1,aux.Stringid(id,2)) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ANCIENT_WARRIORS) 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:
You can Ritual Summon this card with "Sprite's Blessing". When your opponent activates a card or effect that targets a monster you control (Quick Effect): You can discard this card; negate the activation. When your opponent would Special Summon a monster(s) (Quick Effect): You can return this card to the hand; negate the Special Summon, and if you do, banish that monster(s).
--古聖戴サウラヴィス --Sauravis, the Ancient and Ascended local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Negate the activation of an opponent's effect that targets a monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.negcon) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0) end) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) end) c:RegisterEffect(e1) --Negate an opponent's Special Summon, and if you do, banish that monster(s) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_SPSUMMON) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.negsumcon) e2:SetCost(Cost.SelfToHand) e2:SetTarget(s.negsumtg) e2:SetOperation(s.negsumop) c:RegisterEffect(e2) end s.listed_names={37626500} --"Sprite's Blessing" function s.negconfilter(c,tp) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) if not (rp==1-tp and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and Duel.IsChainNegatable(ev)) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(s.negconfilter,1,nil,tp) end function s.negsumcon(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp and Duel.GetCurrentChain()==0 end function s.negsumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(Card.IsAbleToRemove,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,#eg,tp,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,#eg,tp,0) end function s.negsumop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateSummon(eg) Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your End Phase: You can target 2 "Constellar" Xyz Monsters you control that have Xyz Material; detach all Xyz Materials from both Xyz Monsters, and if you do, halve your opponent's LP. You can only use this effect of "Constellar Tempest" once per Duel. Once per turn, during your Standby Phase: You can target 1 "Constellar" Xyz Monster you control and 1 "Constellar" monster in your Graveyard; attach that monster from the Graveyard to that Xyz Monster as an Xyz Material.
--セイクリッド・テンペスト --Constellar Tempest 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) --lp local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL) e2:SetCondition(s.condition) e2:SetTarget(s.lptg) e2:SetOperation(s.lpop) c:RegisterEffect(e2) --material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetCondition(s.condition) e3:SetTarget(s.mattg) e3:SetOperation(s.matop) c:RegisterEffect(e3) end s.listed_series={SET_CONSTELLAR} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_CONSTELLAR) and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0 end function s.lptg(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,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,2,2,nil) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() if tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then local og1=tc1:GetOverlayGroup() local og2=tc2:GetOverlayGroup() og1:Merge(og2) if Duel.SendtoGrave(og1,REASON_EFFECT)<#og1 then return end Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) end end function s.tgfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CONSTELLAR) and c:IsType(TYPE_XYZ) end function s.mfilter(c) return c:IsSetCard(SET_CONSTELLAR) and c:IsMonster() end function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(s.mfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g1=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local g2=Duel.SelectTarget(tp,s.mfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g2,1,0,0) end function s.matop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=e:GetLabelObject() if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,tc,e) if #g>0 then Duel.Overlay(tc,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target up to 2 monsters your opponent controls; banish them until the End Phase, then your opponent gains 1000 LP for each monster that left the field by this effect.
--イチロクの魔物台帳 --Ichiroku's Ledger Book --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Banish up to 2 of opponent's monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end --Activation legality function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end --Banish up to 2 of opponent's monsters until End Phase function s.activate(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if Duel.Remove(tg,0,REASON_EFFECT|REASON_TEMPORARY)>0 then local c=e:GetHandler() for rc in tg:Iter() do local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetLabelObject(rc) e1:SetCountLimit(1) e1:SetOperation(s.retop) Duel.RegisterEffect(e1,tp) end end --Opponent gains 1000 LP per affected monster local og=Duel.GetOperatedGroup() if #og>0 then Duel.BreakEffect() Duel.Recover(1-tp,#og*1000,REASON_EFFECT) end end function s.retop(e,tp,eg,ep,ev,re,r,rp) Duel.ReturnToField(e:GetLabelObject()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] You can target 1 "Performapal" or "Odd-Eyes" card in your GY; add it to your hand, then destroy this card. You can only use this effect of "Performapal Odd-Eyes Seer" once per turn. ---------------------------------------- [ Monster Effect ] During your Main Phase, if you control this Pendulum Summoned card: You can activate the following effect, based on its battle position; ● Attack Position: You can banish this card, then target 1 "Performapal" or "Odd-Eyes" monster in your GY; Special Summon it. ● Defense Position: Take 1 "Performapal" or "Odd-Eyes" Pendulum Monster from your Deck, and either add it to your face-up Extra Deck or send it to the GY. You can only use this effect of "Performapal Odd-Eyes Seer" once per turn.
--EMオッドアイズ・プリースト --Performapal Odd-Eyes Seer --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) --Add to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,{id,0}) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) 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_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.con(POS_FACEUP_ATTACK)) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Add to Extra Deck or send to the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.con(POS_FACEUP_DEFENSE)) e3:SetTarget(s.target) e3:SetOperation(s.operation) c:RegisterEffect(e3) end s.listed_series={SET_PERFORMAPAL,SET_ODD_EYES} function s.thfilter(c) return (c:IsSetCard(SET_ODD_EYES) or c:IsSetCard(SET_PERFORMAPAL)) 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) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then Duel.BreakEffect() Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end function s.con(pos) return function(e) local c=e:GetHandler() return c:IsPendulumSummoned() and c:IsPosition(pos) end end function s.spfilter(c,e,tp) return (c:IsSetCard(SET_ODD_EYES) or c:IsSetCard(SET_PERFORMAPAL)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>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 function s.filter(c) return (c:IsSetCard(SET_ODD_EYES) or c:IsSetCard(SET_PERFORMAPAL)) and c:IsType(TYPE_PENDULUM) and (not c:IsForbidden() or 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.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if not tc then return end local b1=not tc:IsForbidden() local b2=tc:IsAbleToGrave() if not (b1 or b2) then return end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,4)}, {b2,aux.Stringid(id,5)}) if op==1 then Duel.SendtoExtraP(tc,tp,REASON_EFFECT) elseif op==2 then Duel.SendtoGrave(tc,REASON_EFFECT) 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 banishing 3 "Meklord" monsters with different names from your GY. Once per turn, when this card declares an attack: You can look at your opponent's Extra Deck and equip 1 monster from it to this card. This card gains ATK equal to the combined ATK of those equipped monsters. While equipped with a Synchro Monster, this card can make up to 3 attacks on monsters during each Battle Phase.
--機皇神龍トリスケリア --Meklord Astro Dragon Triskelion --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Must first be Special Summoned (from your hand) by banishing 3 "Meklord" monsters with different names from your GY local e0=Effect.CreateEffect(c) e0:SetDescription(aux.Stringid(id,0)) e0:SetType(EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SPSUMMON_PROC) e0:SetRange(LOCATION_HAND) e0:SetCondition(s.spcon) e0:SetTarget(s.sptg) e0:SetOperation(s.spop) c:RegisterEffect(e0) --Look at your opponent's Extra Deck and equip 1 monster from it to this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --This card gains ATK equal to the combined ATK of those equipped monsters local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetValue(function(e,c) return e:GetHandler():GetEquipGroup():Filter(Card.HasFlagEffect,nil,id):GetSum(Card.GetAttack) end) c:RegisterEffect(e2) --While equipped with a Synchro Monster, this card can make up to 3 attacks on monsters during each Battle Phase local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e3:SetRange(LOCATION_MZONE) e3:SetCondition(function(e) return e:GetHandler():GetEquipGroup():IsExists(Card.IsOriginalType,1,nil,TYPE_SYNCHRO) end) e3:SetValue(2) c:RegisterEffect(e3) end s.listed_series={SET_MEKLORD} function s.spcostfilter(c) return c:IsSetCard(SET_MEKLORD) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.rescon(sg,e,tp,mg) return Duel.GetMZoneCount(tp,sg)>0 and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) return #rg>=2 and aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) local g=aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,1,tp,HINTMSG_REMOVE,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.Remove(g,POS_FACEUP,REASON_COST) g:DeleteGroup() end function s.eqfilter(c,tp) return c:CheckUniqueOnField(tp) and c:IsMonster() and not c:IsForbidden() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.eqfilter,tp,0,LOCATION_EXTRA,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_EXTRA) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then local g=Duel.GetMatchingGroup(s.eqfilter,tp,0,LOCATION_EXTRA,nil,tp) if #g==0 then return end Duel.ConfirmCards(tp,Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)) if c:IsFacedown() then return Duel.ShuffleExtra(1-tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=g:Select(tp,1,1,nil):GetFirst() Duel.ShuffleExtra(1-tp) if ec and Duel.Equip(tp,ec,c,true) then ec:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) --Equip limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetValue(function(e,_c) return _c==c end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) ec:RegisterEffect(e1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Insect, Plant, and Reptile monsters on the field gain 300 ATK/DEF, also all other monsters on the field lose 300 ATK/DEF. During your Main Phase: You can activate 1 of these effects; ● Add 1 "Ragnaraika" monster from your Deck to your hand, then discard 1 card. ● Special Summon 1 of your "Ragnaraika" monsters from your hand, GY, or banishment, in Defense Position. You can only use this effect of "Ragnaraika Bloom" once per turn.
--蕾禍繚乱狂咲 --Ragnaraika Bloom --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Insect, Plant, and Reptile monsters gain 300 ATK/DEF local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_SZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetValue(function(e,c) return c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) and 300 or -300 end) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --Activate 1 of these effects local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.efftg) e3:SetOperation(s.effop) c:RegisterEffect(e3) end s.listed_series={SET_RAGNARAIKA} function s.thfilter(c) return c:IsSetCard(SET_RAGNARAIKA) and c:IsMonster() and c:IsAbleToHand() end function s.spfilter(c,e,tp) return c:IsSetCard(SET_RAGNARAIKA) and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED|LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,1)}, {b2,aux.Stringid(id,2)}) e:SetLabel(op) if op==1 then e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) elseif op==2 then e:SetCategory(CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED|LOCATION_HAND|LOCATION_GRAVE) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then --Add 1 "Ragnaraika" monster from your Deck to your hand, then discard 1 card 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_DISCARD|REASON_EFFECT) end elseif op==2 then --Special Summon 1 of your "Ragnaraika" monsters that is banished, or in your hand or GY, in Defense Position if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_REMOVED|LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a player would take damage from a battle involving this card, they gain that much LP, instead.
--衛生兵マッスラー --Muscle Medic local s,id=GetID() function s.initial_effect(c) --damage conversion local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_REVERSE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(1,1) e1:SetValue(s.rev) c:RegisterEffect(e1) end function s.rev(e,re,r,rp,rc) return r&REASON_BATTLE~=0 and (Duel.GetAttacker()==e:GetHandler() or (Duel.GetAttackTarget() and Duel.GetAttackTarget()==e:GetHandler())) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with "Commencement Dance".
--ダンシング・ソルジャー --Performance of Sword local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() end s.listed_names={43417563}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a monster you control. Once per turn, you can look at 1 random card in your opponent's hand. The equipped monster cannot attack the turn you activate this effect.
--Ωメガネ --Omega Goggles local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,0) --confirm local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCost(s.cfcost) e3:SetTarget(s.cftg) e3:SetOperation(s.cfop) c:RegisterEffect(e3) end function s.cfcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetEquipTarget():GetAttackAnnouncedCount()==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.cftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end end function s.cfop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if #g==0 then return end local sg=g:RandomSelect(tp,1) Duel.ConfirmCards(tp,sg) Duel.ShuffleHand(1-tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can Special Summon 1 Zombie monster from your hand. You must control no monsters to activate and to resolve this effect.
--ミイラの呼び声 --Call of the Mummy 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 e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_SZONE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end function s.filter(c,e,sp) return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,sp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.operation(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 if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) 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:
The Battle Positions of face-up monsters that are flipped face-up after activation of this card cannot be changed, except with a card effect.
--砂漠の裁き --Judgment of the Desert 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) -- local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHANGE_POS) e2:SetRange(LOCATION_SZONE) e2:SetOperation(s.posop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e3:SetTarget(s.postg) c:RegisterEffect(e3) end function s.cfilter(c) return c:IsFaceup() and c:IsPreviousPosition(POS_FACEDOWN) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(s.cfilter,nil) local tc=g:GetFirst() for tc in aux.Next(g) do e:GetHandler():SetCardTarget(tc) end end function s.postg(e,c) return e:GetHandler():IsHasCardTarget(c) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a player activates "Pot of Greed": Activate this effect; they can draw 1 card. This card must be in face-up Attack Position to activate and to resolve this effect.
--強欲な壺の精霊 --Spirit of the Pot of Greed local s,id=GetID() function s.initial_effect(c) --The player that activates "Pot of Greed" can draw 1 card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.drcon) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) end s.listed_names={55144522} --"Pot of Greed" function s.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsAttackPos() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(55144522) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(rp) Duel.SetTargetParam(1) Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,rp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (c:IsRelateToEffect(e) and c:IsAttackPos() and c:IsFaceup()) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.IsPlayerCanDraw(p,d) and Duel.SelectYesNo(p,aux.Stringid(id,1)) then Duel.Draw(p,d,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon this card as an Effect Monster (Spellcaster/DARK/Level 9/ATK 1450/DEF 1950). (This card is also still a Trap.) If Summoned this way, this card can be used as a substitute for any 1 Fusion Material that lists an Attribute, on a "Shaddoll" Fusion Monster Card. If this card is sent to the GY by a card effect: You can target 1 "Shaddoll" Spell/Trap in your GY, except "Shaddoll Core"; add it to your hand. * The above text is unofficial and describes the card's functionality in the OCG.
--影依の原核 --Shaddoll Core local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_TO_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) 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) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,1450,1950,9,RACE_SPELLCASTER,ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,1450,1950,9,RACE_SPELLCASTER,ATTRIBUTE_DARK) then return end c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) c:AddMonsterAttributeComplete() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(id) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1,true) Duel.SpecialSummonComplete() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) end function s.thfilter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsSpellTrap() and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc: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,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:
When this card is Normal Summoned: You can send 1 WATER monster from your Deck to the GY; add 1 "Genex Controller" from your Deck to your hand.
--ジェネクス・ウンディーネ --Genex Undine 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:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={68505803} function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.filter(c) return c:IsCode(68505803) 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 tc=Duel.GetFirstMatchingCard(s.filter,tp,LOCATION_DECK,0,nil) if tc then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your opponent's turn: You can banish this card from your Graveyard; negate the next attack this turn from a monster your opponent controls (this is a Quick Effect).
--ネクロ・ガードナー --Necro Gardna local s,id=GetID() function s.initial_effect(c) --disable attack local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_ATTACK) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfBanish) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and (Duel.IsAbleToEnterBP() or Duel.IsBattlePhase()) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetAttacker() then Duel.NegateAttack() else local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetCountLimit(1) e1:SetOperation(s.disop) Duel.RegisterEffect(e1,tp) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.NegateAttack() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 monsters Monsters this card points to lose 800 ATK/DEF. When a Cyberse Link Monster is Link Summoned to your field, while this card is in the GY, except the turn this card was sent to the GY: You can Special Summon this card to your zone that monster points to, but it cannot be used as Link Material, also banish it when it leaves the field.
--スペース・インシュレイター --Space Insulator local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Link summon procedure Link.AddProcedure(c,nil,2,2) --Monsters this card points to loses 800 ATK/DEF local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTarget(s.tgtg) e1:SetValue(-800) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --Special summon itself from GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_GRAVE) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end function s.tgtg(e,c) return e:GetHandler():GetLinkedGroup():IsContains(c) end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsLinkMonster() and c:IsLinkSummoned() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) and aux.exccon(e) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local zone=0 local lg=eg:Filter(s.cfilter,nil,tp) for tc in aux.Next(lg) do zone=(zone|tc:GetLinkedZone()) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) 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() local zone=0 local lg=eg:Filter(s.cfilter,nil,tp) for tc in aux.Next(lg) do zone=(zone|tc:GetLinkedZone()) end if c:IsRelateToEffect(e) and zone~=0 and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP,zone) then --Cannot be used as link material local e1=Effect.CreateEffect(c) e1:SetDescription(3312) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1,true) --Banish it if it leaves the field local e2=Effect.CreateEffect(c) e2:SetDescription(3300) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e2:SetValue(LOCATION_REMOVED) e2:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e2,true) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal Summoned: You can target up to 2 monsters in your opponent's GY; Special Summon those monsters to your field in Defense Position, but their effects are negated. When a monster's effect is activated, while a monster(s) with its same name is in the GY(s) (Quick Effect): You can negate the activation. If a monster(s) is Special Summoned from your opponent's GY: You can Tribute 2 monsters; Special Summon this card from your GY. You can only use each effect of "Vampire Voivode" once per turn.
--竜血公ヴァンパイア --Vampire Voivode --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --If normal summoned, special summon up to 2 monsters from opponent's GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Negate the activation of a monster effect local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_NEGATE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) e2:SetTarget(s.negtg) e2:SetOperation(function(_,_,_,_,ev)Duel.NegateActivation(ev)end) c:RegisterEffect(e2) --Special summon itself from GY local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_GRAVE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,{id,2}) e3:SetCost(s.sscost) e3:SetCondition(s.sscon) e3:SetTarget(s.sstg) e3:SetOperation(s.ssop) c:RegisterEffect(e3) end --Check for a monster to special summon function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) if ct>2 then ct=2 end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ct=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,1,ct,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) end --Special summon up to 2 monsters from opponent's GY function s.spop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) if ct<1 then return end local g=Duel.GetTargetCards(e) if #g==0 then return end if #g>ct or (#g>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) g=g:Select(tp,1,1,nil) end local tc=g:GetFirst() for tc in aux.Next(g) do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) --Negate effect(s) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2,true) end Duel.SpecialSummonComplete() end --If a monster effect is activated function s.negcon(e,tp,eg,ep,ev,re,r,rp) return re:IsMonsterEffect() and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode()) end --Activation legality 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) end --Check if a monster was special summoned from opponent's GY function s.cfilter(c,tp) return c:IsSummonLocation(LOCATION_GRAVE) and c:IsPreviousControler(1-tp) and c:IsOriginalType(TYPE_MONSTER) end --If it ever happened function s.sscon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end --Tribute 2 monsters as cost function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,2,false,aux.ReleaseCheckMMZ,nil) end local g=Duel.SelectReleaseGroupCost(tp,nil,2,2,false,aux.ReleaseCheckMMZ,nil) Duel.Release(g,REASON_COST) end --Activation legality function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end --Special summon itself from GY function s.ssop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent's monster declares an attack: Tribute 1 monster, then target the attacking monster; destroy that target, then inflict 1000 damage to your opponent.
--カオス・バースト --Chaos Burst local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,nil) end local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,nil) Duel.Release(g,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local tg=Duel.GetAttacker() if chkc then return chkc==tg end if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:CanAttack() and not tc:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.BreakEffect() Duel.Damage(1-tp,1000,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Main Phase (Quick Effect): You can Special Summon this card from your hand, and if you do, banish 1 "Kashtira" or "Tearlaments" card from your hand or GY. If this card is Normal or Special Summoned: You can send the top 3 cards of either player's Deck to the GY. If this card is sent to the GY by card effect: You can send the top 2 cards of your Deck to the GY. You can only use each effect of "Tearlaments Kashtira" once per turn.
--スティアラメンツ・クシャトリラ --Tearlaments Kashtira --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Mill 3 cards from either Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DECKDES) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.smltg) e2:SetOperation(s.smlop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --Mill 2 cards from your Deck local e4=e2:Clone() e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_DECKDES) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_TO_GRAVE) e4:SetCountLimit(1,{id,2}) e4:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end) e4:SetTarget(s.tgmltg) e4:SetOperation(s.tgmlop) c:RegisterEffect(e4) end s.listed_series={SET_TEARLAMENTS,SET_KASHTIRA} function s.rmfilter(c) return c:IsSetCard({SET_TEARLAMENTS,SET_KASHTIRA}) and c:IsAbleToRemove() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,c) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,1,nil) if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end function s.smltg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) or Duel.IsPlayerCanDiscardDeck(1-tp,3) end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_EITHER,3) end function s.smlop(e,tp,eg,ep,ev,re,r,rp) local b1=Duel.IsPlayerCanDiscardDeck(tp,3) local b2=Duel.IsPlayerCanDiscardDeck(1-tp,3) local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,3)}, {b2,aux.Stringid(id,4)}) if op then Duel.DiscardDeck(op==1 and tp or 1-tp,3,REASON_EFFECT) end end function s.tgmltg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2) end function s.tgmlop(e,tp,eg,ep,ev,re,r,rp) Duel.DiscardDeck(tp,2,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Tribute Summoned: You can target up to 2 Spell/Trap Cards on the field; destroy those targets.
--氷帝メビウス --Mobius the Frost Monarch local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_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():IsTributeSummoned() end function s.filter(c) return c:IsSpellTrap() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=tg:Filter(Card.IsRelateToEffect,nil,e) Duel.Destroy(sg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 DARK monster with 2000 or more DEF; look at your opponent's hand, all monsters they control, and all cards they draw until the 3rd end of their turn, and destroy all those monsters with 1500 or less DEF. * The above text is unofficial and describes the card's functionality in the OCG.
--影のデッキ破壊ウイルス --Full Force Virus 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:SetHintTiming(0,TIMING_TOHAND|TIMINGS_CHECK_MONSTER) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.costfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsDefenseAbove(2000) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil) end local g=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil) Duel.Release(g,REASON_COST) end function s.tgfilter(c) return c:IsFaceup() and c:IsDefenseBelow(1500) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(s.tgfilter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.filter(c) return c:IsMonster() and c:IsDefenseBelow(1500) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local conf=Duel.GetFieldGroup(tp,0,LOCATION_MZONE|LOCATION_HAND) if #conf>0 then Duel.ConfirmCards(tp,conf) local dg=conf:Filter(s.filter,nil) Duel.Destroy(dg,REASON_EFFECT) Duel.ShuffleHand(1-tp) end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_DRAW) e1:SetOperation(s.desop) e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,3) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetCondition(s.turncon) e2:SetOperation(s.turnop) e2:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,3) Duel.RegisterEffect(e2,tp) e2:SetLabelObject(e1) local descnum=tp==c:GetOwner() and 0 or 1 local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetDescription(aux.Stringid(id,descnum)) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e3:SetCode(1082946) e3:SetLabelObject(e2) e3:SetOwnerPlayer(tp) e3:SetOperation(s.reset) e3:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,3) c:RegisterEffect(e3) local e4=Effect.CreateEffect(e:GetHandler()) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e4:SetDescription(aux.Stringid(id,3)) e4:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,3) e4:SetTargetRange(0,1) Duel.RegisterEffect(e4,tp) end function s.reset(e,tp,eg,ep,ev,re,r,rp) s.turnop(e:GetLabelObject(),tp,eg,ep,ev,e,r,rp) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if ep==e:GetOwnerPlayer() then return end local hg=eg:Filter(Card.IsLocation,nil,LOCATION_HAND) if #hg==0 then return end Duel.ConfirmCards(1-ep,hg) local dg=hg:Filter(s.filter,nil) Duel.Destroy(dg,REASON_EFFECT) Duel.ShuffleHand(ep) end function s.turncon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.turnop(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetLabel() ct=ct+1 e:SetLabel(ct) e:GetHandler():SetTurnCounter(ct) if ct==3 then e:GetLabelObject():Reset() if re then re:Reset() end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: You can add 1 "Shaddoll" Spell/Trap from your Deck to your hand. If this card is sent to the GY by a card effect: You can add 1 "Shaddoll" monster from your Deck to your hand, except "Shaddoll Hedgehog". You can only use 1 "Shaddoll Hedgehog" effect per turn, and only once that turn.
--シャドール・ヘッジホッグ --Shaddoll Hedgehog local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) e2:SetCost(s.cost) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_SHADDOLL} s.listed_names={id} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) end function s.filter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsSpellTrap() 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 function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) end function s.thfilter(c) return c:IsSetCard(SET_SHADDOLL) 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 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is sent from the field to the Graveyard by a card effect, take control of 1 Defense Position monster your opponent controls.
--インフォーマー・スパイダー --Informer Spider local s,id=GetID() function s.initial_effect(c) --control local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_CONTROL) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) end function s.filter(c) return c:IsDefensePos() and c:IsControlerCanBeChanged() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsDefensePos() and tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 7 Dragon monsters (Quick Effect): You can send 1 Level 7 "Dragon Ruler" monster from your Deck to the GY and detach 1 material from this card; this effect becomes that sent monster's effect that discards itself to activate. 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 Special Summon 1 Level 7 "Dragon Ruler" monster from your GY or banishment. You can only use each effect of "Chasma, Dragon Ruler of Auroras" once per turn.
--極征竜-シャスマティス --Chasma, Dragon Ruler of Auroras --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) --This effect becomes the effect of a Level 7 "Dragon Ruler" monster that activates by discarding itself local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetCost(Cost.AND(s.applycost,Cost.DetachFromSelf(1))) e1:SetTarget(s.applytg) e1:SetOperation(s.applyop) c:RegisterEffect(e1) --Special Summon 1 Level 7 "Dragon Ruler" from your GY or banishment local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_DRAGON_RULER} function s.runfn(fn,eff,tp,chk) return not fn or fn(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,nil,REASON_EFFECT,PLAYER_NONE,chk) end function s.applyfilter(c,tp) if not (c:IsSetCard(SET_DRAGON_RULER) and c:IsLevel(7) and c:IsAbleToGraveAsCost()) then return false end for _,eff in ipairs({c:GetOwnEffects()}) do if eff:HasSelfDiscardCost() and s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) then return true end end return false end function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sc=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() local effs={} local options={} for _,eff in ipairs({sc:GetOwnEffects()}) do if eff:HasSelfDiscardCost() then table.insert(effs,eff) local eff_chk=s.runfn(eff:GetCondition(),eff,tp,0) and s.runfn(eff:GetTarget(),eff,tp,0) table.insert(options,{eff_chk,eff:GetDescription()}) end end local op=#options==1 and 1 or Duel.SelectEffect(tp,table.unpack(options)) local te=effs[op] e:SetLabelObject(te) Duel.SendtoGrave(sc,REASON_COST) end function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local te=e:GetLabelObject() if chkc then return te and te:GetTarget() and te:GetTarget()(e,tp,eg,ep,ev,re,r,rp,0,chkc) end if chk==0 then return true end e:SetLabel(te:GetLabel()) e:SetLabelObject(te:GetLabelObject()) e:SetProperty(te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and EFFECT_FLAG_CARD_TARGET or 0) local tg=te:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) te:SetLabel(e:GetLabel()) te:SetLabelObject(e:GetLabelObject()) Duel.ClearOperationInfo(0) end e:SetLabelObject(te) end function s.applyop(e,tp,eg,ep,ev,re,r,rp) local te=e:GetLabelObject() if not te then return end local op=te:GetOperation() if op then e:SetLabel(te:GetLabel()) e:SetLabelObject(te:GetLabelObject()) op(e,tp,eg,ep,ev,re,r,rp) end e:SetProperty(0) e:SetLabel(0) e:SetLabelObject(nil) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_DRAGON_RULER) and c:IsLevel(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() 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_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) 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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Monsters cannot target Level 6 or lower "Harpie" monsters for attacks. You can only use each of the following effects of "Harpie's Pet Dragon - Fearsome Fire Blast" once per turn. If you control a Level 6 or lower WIND monster: You can Special Summon this card from your hand in Defense Position. If this card is sent from the field to the GY: You can send 1 WIND Winged Beast monster from your Deck to the GY.
--ハーピィズペット竜-セイント・ファイアー・ギガ --Harpie's Pet Dragon - Fearsome Fire Blast --scripted by Hatter local s,id=GetID() function s.initial_effect(c) --monsters cannot target Harpies for attacks local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetValue(s.atlimit) c:RegisterEffect(e1) --special summon itself from 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) --send to GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.gycon) e3:SetTarget(s.gytg) e3:SetOperation(s.gyop) c:RegisterEffect(e3) end s.listed_series={SET_HARPIE} function s.atlimit(e,c) return c:IsFaceup() and c:IsLevelBelow(6) and c:IsSetCard(SET_HARPIE) end function s.filter(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsLevelBelow(6) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.filter,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,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) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.gycon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.gyfilter(c) return c:IsMonster() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WINGEDBEAST) and c:IsAbleToGrave() end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.gyfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.gyfilter,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:
2 Level 3 monsters If the battle position of this card is changed: You can Special Summon 1 Insect monster from your hand or GY in Defense Position. When a monster on the field activates its effect (Quick Effect): You can detach 1 material from this card, then target that monster; negate its effects, then make 1 Insect monster on the field either gain 500 DEF, or change its battle position. You can only use each effect of "Number 3: Cicada King" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--No.3 地獄蝉王ローカスト・キング --Number 3: Cicada King --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Xyz.AddProcedure(c,nil,3,2) --Special Summon an Insect local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_CHANGE_POS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Negate effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.discon) e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) end s.xyz_number=3 function s.spfilter(c,e,tp) return 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) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.discon(e,tp,eg,ep,ev,re,r,rp) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) local rc=re:GetHandler() return (loc&LOCATION_ONFIELD)~=0 and re:IsMonsterEffect() and re:GetHandler():IsNegatableMonster() and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:GetHandler():IsRelateToEffect(re) and rc:IsCanBeEffectTarget(e) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetCard(re:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_INSECT) and (not c:IsType(TYPE_LINK) or c:IsCanChangePosition()) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) --Negate effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.Clone(e1) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) tc:RegisterEffect(e2) if tc:IsImmuneToEffect(e1) or tc:IsImmuneToEffect(e2) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local sc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst() if not sc then return end Duel.HintSelection(Group.FromCards(sc),true) Duel.BreakEffect() if sc:IsCanChangePosition() and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.ChangePosition(sc,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,0) else --Gain 500 DEF local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetValue(500) e3:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e3) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by sending 3 "Cubic" monsters you control to the GY, and cannot be Special Summoned by other ways. If Summoned this way, this card gains 3000 ATK. This card can make a second and third attack during each Battle Phase. If this card in your possession is sent to your GY by your opponent: You can target up to 3 "Cubic" monsters in your GY; Special Summon them, then you can add 1 "Cubic" card from your Deck or GY to your hand. * The above text is unofficial and describes the card's functionality in the OCG.
--方界超獣バスター・ガンダイル --Buster Gundil the Cubic Behemoth local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --cannot special summon 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 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) --extra att local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_EXTRA_ATTACK) e3:SetValue(2) c:RegisterEffect(e3) --special summon local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(s.spcon2) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) c:RegisterEffect(e4) end s.listed_series={SET_CUBIC} function s.tgfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CUBIC) and c:IsAbleToGraveAsCost() end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_MZONE,0,nil) return #rg>0 and aux.SelectUnselectGroup(rg,e,tp,3,3,aux.ChkfMMZ(1),0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local g=nil local rg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_MZONE,0,nil) local g=aux.SelectUnselectGroup(rg,e,tp,3,3,aux.ChkfMMZ(1),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(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(3000) e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD)) e:GetHandler():RegisterEffect(e1) g:DeleteGroup() end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and e:GetHandler():IsPreviousControler(tp) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_CUBIC) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end local ft=3 if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_DECK) end function s.thfilter(c) return c:IsSetCard(SET_CUBIC) and c:IsAbleToHand() end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local g=Duel.GetTargetCards(e) if #g>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if #g>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) g=g:Select(tp,ft,ft,nil) end if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,nil) if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) sg=sg:Select(tp,1,1,nil) Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) Duel.ShuffleDeck(tp) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Special Summoned. You can Tribute 5 monsters to Tribute Summon (but not Set) this card. This card's ATK/DEF become the combined original ATK/DEF of the Tributed monsters. If this card Summoned this way destroys a DARK Fiend monster owned by your opponent, you win the Duel at the end of the Damage Step.
--守護神エクゾディア --Exodia, the Legendary Defender --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --cannot special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) c:RegisterEffect(e1) --win local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetRange(LOCATION_MZONE) e2:SetOperation(s.winop) c:RegisterEffect(e2) --summon with 5 tribute local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SUMMON_PROC) e3:SetCondition(s.ttcon) e3:SetOperation(s.ttop) e3:SetValue(SUMMON_TYPE_TRIBUTE+1) c:RegisterEffect(e3) --tribute check local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_MATERIAL_CHECK) e4:SetValue(s.valcheck) c:RegisterEffect(e4) --give atk/def effect only when summonned local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_SUMMON_COST) e5:SetOperation(s.facechk) e5:SetLabelObject(e4) c:RegisterEffect(e5) end function s.winop(e,tp,eg,ep,ev,re,r,rp) local des=eg:GetFirst() local rc=des:GetReasonCard() if (des:GetPreviousRaceOnField()&RACE_FIEND==RACE_FIEND and des:GetPreviousAttributeOnField()&ATTRIBUTE_DARK==ATTRIBUTE_DARK and des:GetOwner()==(1-tp) and rc:IsRelateToBattle() and rc==e:GetHandler() and rc:GetSummonType()==SUMMON_TYPE_TRIBUTE+1) then Duel.Win(tp,WIN_REASON_EXODIA_DEFENDER) end end function s.ttcon(e,c,minc) if c==nil then return true end return minc<=5 and Duel.CheckTribute(c,5) end function s.ttop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectTribute(tp,c,5,5) c:SetMaterial(g) Duel.Release(g, REASON_SUMMON+REASON_MATERIAL) end function s.valcheck(e,c) local g=c:GetMaterial() local atk=0 local def=0 for tc in aux.Next(g) do local catk=tc:GetTextAttack() atk=atk+(catk>=0 and catk or 0) local cdef=tc:GetTextDefense() def=def+(cdef>=0 and cdef or 0) end if e:GetLabel()==1 then e:SetLabel(0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(atk) e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD)) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) e2:SetValue(def) c:RegisterEffect(e2) end end function s.facechk(e,tp,eg,ep,ev,re,r,rp) e:GetLabelObject():SetLabel(1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: During the End Phase of this turn, destroy as many Defense Position monsters your opponent controls as possible, and if you do, inflict 500 damage to your opponent for each monster destroyed.
--占術姫ウィジャモリガン --Prediction Princess Astromorrigan local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) e1:SetOperation(s.flipop) c:RegisterEffect(e1) end function s.flipop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --destroy local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetOperation(s.desop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.desfilter(c) return c:IsDefensePos() end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) if #g>0 then Duel.Hint(HINT_CARD,0,id) local ct=Duel.Destroy(g,REASON_EFFECT) Duel.Damage(1-tp,ct*500,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 3 monsters Once per turn: You can detach 1 Xyz Material from this card; inflict 100 damage to your opponent for each of your banished monsters.
--潜航母艦エアロ・シャーク --Submersible Carrier Aero Shark local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsMonster() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,1,nil) end local ct=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_REMOVED,0,nil) Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(ct*100) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*100) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_REMOVED,0,nil) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Damage(p,ct*100,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during your Main Phase or your opponent's Battle Phase: You can Special Summon 1 "tellarknight" monster from your hand.
--神星なる波動 --Stellarnova Wave local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Special Summon 1 "tellarknight" monster from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1) e1:SetCondition(function(e,tp) return Duel.IsMainPhase(tp) or Duel.IsBattlePhase(1-tp) end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_BATTLE_PHASE|TIMING_BATTLE_STEP_END|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER) c:RegisterEffect(e1) end s.listed_series={SET_TELLARKNIGHT} function s.spfilter(c,e,tp) return c:IsSetCard(SET_TELLARKNIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 LIGHT monster to target 1 banished monster; your opponent can reveal 1 Trap Card from their hand to negate this card's effect, otherwise you Special Summon that monster.
--光霊術-「聖」 --Spiritual Light Art - Hijiri 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.rfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.rfilter,1,false,aux.ReleaseCheckMMZ,nil) end local g=Duel.SelectReleaseGroupCost(tp,s.rfilter,1,1,false,aux.ReleaseCheckMMZ,nil) Duel.Release(g,REASON_COST) end function s.filter(c,e,tp) return c:IsFaceup() 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_REMOVED) and s.filter(chkc,e,tp) end if chk==0 then if e:GetLabel()==1 then e:SetLabel(0) return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) else return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) end end e:SetLabel(0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.cfilter(c) return not c:IsPublic() and c:IsTrap() end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.IsChainDisablable(0) then local sel=1 local g=Duel.GetMatchingGroup(s.cfilter,tp,0,LOCATION_HAND,nil) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,0)) if #g>0 then sel=Duel.SelectOption(1-tp,1213,1214) else sel=Duel.SelectOption(1-tp,1214)+1 end if sel==0 then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM) local sg=g:Select(1-tp,1,1,nil) Duel.ConfirmCards(tp,sg) Duel.ShuffleHand(1-tp) Duel.NegateEffect(0) return end 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:
1 Tuner + 1+ non-Tuner monsters When your opponent activates a monster effect (Quick Effect): You can banish it. If this attacking card destroys an Effect Monster by battle and sends it to the GY: This card gains ATK equal to the destroyed monster's original ATK, also it can make a second attack on a monster during this Battle Phase. You can only use each effect of "Draco Berserker of the Tenyi" once per turn.
--天威の龍鬼神 --Draco Berserker of the Tenyi --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Synchro summon procedure Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --Banish opponent's monster, that activated its effect local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.rmcon) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Gains ATK, also can make a second attack on monsters local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsMonsterEffect() and re:GetHandler():IsRelateToEffect(re) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local rc=re:GetHandler() if chk==0 then return rc:IsAbleToRemove() and not rc:IsLocation(LOCATION_REMOVED) end Duel.SetTargetCard(rc) Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,rc:GetControler(),rc:GetLocation()) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler() if rc:IsRelateToEffect(e) then Duel.Remove(rc,POS_FACEUP,REASON_EFFECT) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return Duel.GetAttacker()==c and c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_EFFECT) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetCard(e:GetHandler():GetBattleTarget()) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) or not c:IsRelateToBattle() then return end local tc=Duel.GetFirstTarget() local value=tc:GetBaseAttack() if value<0 then value=0 end --Gains ATK equal to destroyed monster's original ATK if tc and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(value) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end --Can make a second attack on monsters local e2=Effect.CreateEffect(c) e2:SetDescription(3202) e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e2:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_EXTRA_ATTACK) e3:SetValue(1) c:RegisterEffect(e3) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ monsters Once while face-up on the field (Quick Effect): You can target monsters on the field and/or GY up to the number of monsters co-linked to this card; return them to the hand. If a monster this card points to is destroyed by battle or sent to the GY: You can Special Summon 1 Cyberse monster from your hand. You can only use each effect of "Firewall Dragon" once per turn.
--ファイアウォール・ドラゴン --Firewall Dragon local s,id=GetID() function s.initial_effect(c) --Link Summon procedure Link.AddProcedure(c,nil,2) --Must be properly summoned before reviving c:EnableReviveLimit() --Return monsters from field/GY to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Special Summon 1 Cyberse monster from hand local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCondition(s.regcon) e2:SetOperation(s.regop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.regcon2) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY) e4:SetCountLimit(1,{id,1}) e4:SetCode(EVENT_CUSTOM+id) e4:SetRange(LOCATION_MZONE) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) end function s.thfilter(c) return c:IsMonster() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() local ct=#(c:GetMutualLinkedGroup():Filter(Card.IsMonster,nil)) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.thfilter(chkc) end if chk==0 then return ct>0 and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) Duel.SendtoHand(g,nil,REASON_EFFECT) end function s.cfilter(c,tp,zone) local seq=c:GetPreviousSequence() if not c:IsPreviousControler(tp) then seq=seq+16 end return c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0 end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone()) end function s.cfilter2(c,tp,zone) return not c:IsReason(REASON_BATTLE) and s.cfilter(c,tp,zone) end function s.regcon2(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter2,1,nil,tp,e:GetHandler():GetLinkedZone()) end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,0,0) end function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRace(RACE_CYBERSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if you control an "Aroma" monster: You can gain 500 LP, also all monsters you control gain 500 ATK and DEF until the end of your opponent's next turn (even if this card leaves the field). If a face-up "Aroma" monster you control is destroyed by battle or card effect and sent to the Graveyard: Gain 1000 LP.
--アロマガーデン --Aroma Garden 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) --Gain 500 LP and all monsters you control gain 500 ATK/DEF local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_RECOVER+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1) e2:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_AROMA),tp,LOCATION_MZONE,0,1,nil) end) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) --Gain 1000 LP local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_RECOVER) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_FZONE) e3:SetCondition(s.lpcon) e3:SetTarget(s.lptg) e3:SetOperation(s.lpop) c:RegisterEffect(e3) end s.listed_series={SET_AROMA} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) --All monsters you control gain 500 ATK/DEF until the end of your opponent's next turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetValue(500) e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) Duel.RegisterEffect(e2,tp) end function s.lpcfilter(c,tp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsSetCard(SET_AROMA) and c:IsPreviousSetCard(SET_AROMA) and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.lpcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.lpcfilter,1,nil,tp) end function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Remove from play 1 Tuner monster from your Graveyard. Target face-up monster you control gains ATK equal to the removed monster's ATK.
--イージーチューニング --Battle Tuned local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c,tp) return c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost() and c:GetAttack()>0 and aux.SpElimFilter(c,true) and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) if chk==0 then return true end 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 chkc:IsFaceup() end if chk==0 then if e:GetLabel()~=1 then return false end e:SetLabel(0) 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) local atk=g:GetFirst():GetAttack() if atk<0 then atk=0 end Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetTargetParam(atk) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local atk=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(atk) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can discard 1 card; add 1 "Gladiator Beast" monster from your Deck to your hand. When an opponent's monster declares an attack: You can Special Summon 1 "Gladiator Beast" monster from your Deck, and it cannot be destroyed by battle. During the End Phase, if a "Gladiator Beast" monster was Special Summoned from your Deck this turn: You can Set 1 "Gladiator" Trap from your Deck. You can only use each effect of "Flavian - Colosseum of the Gladiator Beasts" once per turn.
--剣闘獣の闘技場-フラヴィス --Flavian - Colosseum of the Gladiator Beasts --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Add 1 "Gladiator Beast" monster from your Deck to your hand 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_FZONE) e1:SetCountLimit(1,id) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Special Summon 1 "Gladiator Beast" monster from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Set 1 "Gladiator" Trap from your Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1,{id,2}) e3:SetCondition(function(e,tp) return Duel.HasFlagEffect(tp,id) end) e3:SetTarget(s.settg) e3:SetOperation(s.setop) c:RegisterEffect(e3) --Register if a "Gladiator Beast" monster is Special Summoned from the Deck aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_SPSUMMON_SUCCESS) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) end) end s.listed_series={SET_GLADIATOR_BEAST,SET_GLADIATOR} function s.setconfilter(c) return c:IsSetCard(SET_GLADIATOR_BEAST) and c:IsSpecialSummoned() and c:IsSummonLocation(LOCATION_DECK) and c:IsFaceup() end function s.checkop(e,tp,eg,ep,ev,re,r,rp) local sg=eg:Filter(s.setconfilter,nil) for sc in sg:Iter() do local prev_ctrl=sc:GetPreviousControler() if not Duel.HasFlagEffect(prev_ctrl,id) then Duel.RegisterFlagEffect(prev_ctrl,id,RESET_PHASE|PHASE_END,0,1) end end end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.thfilter(c) return c:IsSetCard(SET_GLADIATOR_BEAST) 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 function s.spfilter(c,e,tp) return c:IsSetCard(SET_GLADIATOR_BEAST) 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 sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then --It cannot be destroyed by battle local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3000) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end end function s.setfilter(c) return c:IsSetCard(SET_GLADIATOR) and c:IsTrap() and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] If another "Dinomist" card(s) you control would be destroyed by battle or an opponent's card effect, you can destroy this card instead. ---------------------------------------- [ Monster Effect ] You can Tribute 1 other "Dinomist" monster, then activate 1 of these effects; ● This card can attack your opponent directly this turn. ● This card can make a second attack during each Battle Phase this turn.
--ダイナミスト・スピノス --Dinomist Spinos local s,id=GetID() function s.initial_effect(c) --Enable pendulum summon Pendulum.AddProcedure(c) --Substitute destruction for a "Dinomist" card(s) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetRange(LOCATION_PZONE) e1:SetTarget(s.reptg) e1:SetValue(s.repval) e1:SetOperation(s.repop) c:RegisterEffect(e1) --Activate 1 of 2 effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.atkcon) e2:SetCost(s.atkcost) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.listed_series={SET_DINOMIST} function s.repfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(SET_DINOMIST) and not c:IsReason(REASON_REPLACE) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return eg:IsExists(s.repfilter,1,c,tp) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end return Duel.SelectEffectYesNo(tp,c,96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT|REASON_REPLACE) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsSetCard,1,false,nil,c,SET_DINOMIST) end local rg=Duel.SelectReleaseGroupCost(tp,Card.IsSetCard,1,1,false,nil,c,SET_DINOMIST) Duel.Release(rg,REASON_COST) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local con1=c:GetFlagEffect(id)==0 local con2=c:GetFlagEffect(id+1)==0 if chk==0 then return con1 or con2 end local op=0 if con1 and con2 then op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) elseif con1 then op=Duel.SelectOption(tp,aux.Stringid(id,1)) else op=Duel.SelectOption(tp,aux.Stringid(id,2))+1 end e:SetLabel(op) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local op=e:GetLabel() if op==0 then if c:IsFaceup() and c:IsRelateToEffect(e) then c:RegisterFlagEffect(id,RESETS_STANDARD_DISABLE_PHASE_END,0,0) --Can attack directly local e1=Effect.CreateEffect(c) e1:SetDescription(3205) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end elseif op==1 then if c:IsFaceup() and c:IsRelateToEffect(e) then c:RegisterFlagEffect(id+1,RESETS_STANDARD_DISABLE_PHASE_END,0,0) --Can make a second attack local e2=Effect.CreateEffect(c) e2:SetDescription(3201) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_EXTRA_ATTACK) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e2:SetValue(1) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control an Attack Position Insect monster, you can Special Summon this card (from your hand). You can only Special Summon "Dream Cicada" once per turn this way. If this card is Normal or Special Summoned: You can target 1 monster on the field; change its battle position. You can only use this effect of "Dream Cicada" once per turn.
--夢蝉スイミンミン --Dream Cicada --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from hand if you control an Insect in Attack Position 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) c:RegisterEffect(e1) --Change the battle position of a monster local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.postg) e2:SetOperation(s.posop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttackPos() 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.filter,tp,LOCATION_MZONE,0,1,nil) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanChangePosition() end if chk==0 then return Duel.IsExistingTarget(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Link Monster's effect is activated that targets this face-up card on the field (Quick Effect): You can destroy this card, then destroy 1 monster in the column this card was in, and if you do, destroy any monsters in that card's horizontally adjacent zones. During the End Phase, if this card is in the GY because it was destroyed on the field by battle or card effect and sent there this turn: You can Special Summon 1 "Rokket" monster from your Deck, except "Shelrokket Dragon". You can only use each effect of "Shelrokket Dragon" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--シェルヴァレット・ドラゴン --Shelrokket Dragon --Scripted by Eerie Code; fixed by senpaizuri local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_TO_GRAVE) e2:SetOperation(s.regop) c:RegisterEffect(e2) end s.listed_series={SET_ROKKET} s.listed_names={} function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or not g:IsContains(c) then return false end return re:IsActiveType(TYPE_LINK) end function s.desfilter(c,g) return g:IsContains(c) end function s.desfilter2(c,s,p) local seq=c:GetSequence() return seq<5 and c:IsControler(p) and math.abs(seq-s)==1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c:GetColumnGroup()) if chk==0 then return c:IsDestructable() and #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local lg=c:GetColumnGroup() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,lg) if #g==0 then return end Duel.BreakEffect() local tc=nil if #g==1 then tc=g:GetFirst() else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) tc=g:Select(tp,1,1,nil):GetFirst() end local seq=tc:GetSequence() local dg=Group.CreateGroup() if seq<5 then dg=Duel.GetMatchingGroup(s.desfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,seq,tc:GetControler()) end if Duel.Destroy(tc,REASON_EFFECT)~=0 and #dg>0 then Duel.Destroy(dg,REASON_EFFECT) end end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1,{id,1}) e1:SetRange(LOCATION_GRAVE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ROKKET) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 4 monsters If this card is Xyz Summoned: You can add 1 Cyberse Ritual Monster from your Deck to your hand. You can detach 1 material from this card; Ritual Summon 1 Ritual Monster from your hand, by Tributing monsters from your hand or field whose total Levels equal or exceed its Level. If this card is sent to the GY as Link Material: You can add 1 "A.I." Trap from your Deck to your hand. You can only use each effect of "Code Igniter" once per turn.
--コード・イグナイター --Code Igniter --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure: 2 Level 4 monsters Xyz.AddProcedure(c,nil,4,2) --Add 1 Cyberse Ritual Monster from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,{id,0}) e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e1:SetTarget(s.thtg(s.thfilter1)) e1:SetOperation(s.thop(s.thfilter1)) c:RegisterEffect(e1) --Ritual Summon 1 Ritual Monster from your hand, by Tributing monsters from your hand and/or field whose total Levels equal or exceed its Level local e2=Ritual.CreateProc(c,RITPROC_GREATER,nil,nil,aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.DetachFromSelf(1,1,nil)) c:RegisterEffect(e2) --Add 1 "A.I." Trap from your Deck to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_BE_MATERIAL) e3:SetCountLimit(1,{id,2}) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK end) e3:SetTarget(s.thtg(s.thfilter2)) e3:SetOperation(s.thop(s.thfilter2)) c:RegisterEffect(e3) end s.listed_series={SET_AI} function s.thfilter1(c) return c:IsRace(RACE_CYBERSE) and c:IsRitualMonster() and c:IsAbleToHand() end function s.thfilter2(c) return c:IsSetCard(SET_AI) and c:IsTrap() and c:IsAbleToHand() end function s.thtg(filter) return function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end end function s.thop(filter) return function(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,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 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 1 "R.B." monster from your Deck/Extra Deck with a different name than the cards you control. If an "R.B." monster(s) you control would be destroyed by battle or card effect, you can banish this card from your GY instead. You cannot Special Summon from the Extra Deck the turn you activate this card, except Machine monsters with 1500 or less original ATK.
--JP Name --R.B. Stage Landing --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "R.B." monster from your Deck/Extra Deck with a different name from the cards you control 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:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or (c:IsRace(RACE_MACHINE) and c:GetBaseAttack()<=1500) end) --If an "R.B." monster(s) you control would be destroyed, you can banish this card from your GY instead local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTarget(s.reptg) e2:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end) e2:SetOperation(function(e) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE) end) c:RegisterEffect(e2) end s.listed_series={SET_RB} function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end --You cannot Special Summon from the Extra Deck the turn you activate this card, except Machine monsters with 1500 or less original ATK 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_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not (c:IsRace(RACE_MACHINE) and c:GetBaseAttack()<=1500) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.spfilter(c,e,tp) if not (c:IsSetCard(SET_RB) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,c:GetCode()),tp,LOCATION_ONFIELD,0,1,nil)) then return false end if c:IsLocation(LOCATION_DECK) then return Duel.GetMZoneCount(tp)>0 elseif c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.repfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(SET_RB) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,c,96) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned or Set. Must be Special Summoned (from your hand) by sending 1 face-up "Elemental HERO Neos" and 1 face-up "Yubel" from your Monster Zone to the GY. This card cannot be destroyed by card effects. At the end of the Damage Step, if this card battled an opponent's monster: Inflict damage to your opponent equal to the ATK of the monster it battled, and you gain Life Points equal to that monster's DEF. * The above text is unofficial and describes the card's functionality in the OCG.
--ネオス・ワイズマン --Neos Wiseman local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --special summon rule local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --damage&recover local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_DAMAGE_STEP_END) e3:SetTarget(s.damtg) e3:SetOperation(s.damop) c:RegisterEffect(e3) -- local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e4:SetValue(1) c:RegisterEffect(e4) end s.listed_names={CARD_NEOS,CARD_YUBEL} function s.spfilter(c,...) return c:IsFaceup() and c:IsCode(...) and c:IsAbleToGraveAsCost() end function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg) end function s.chk(c,sg) return c:IsCode(CARD_NEOS) and sg:IsExists(Card.IsCode,1,c,CARD_YUBEL) end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local g1=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,CARD_NEOS) local g2=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,CARD_YUBEL) local g=g1:Clone() g:Merge(g2) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g1>0 and #g2>0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,CARD_NEOS,CARD_YUBEL) local g=aux.SelectUnselectGroup(sg,e,tp,2,2,s.rescon,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) g:DeleteGroup() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetAttackTarget()~=nil end local bc=e:GetHandler():GetBattleTarget() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,bc:GetAttack()) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,bc:GetDefense()) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetHandler():GetBattleTarget() local atk=bc:GetAttack() local def=bc:GetDefense() if atk<0 then atk=0 end if def<0 then def=0 end Duel.Damage(1-tp,atk,REASON_EFFECT,true) Duel.Recover(tp,def,REASON_EFFECT,true) Duel.RDComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Elemental HERO Neos" + "Neo-Spacian Marine Dolphin" Must first be Special Summoned (from your Extra Deck) by shuffling the above cards you control into the Deck. (You do not use "Polymerization".) Once per turn: You can destroy 1 random card in your opponent's hand.
--E・HERO マリン・ネオス --Elemental HERO Marine Neos local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcCode2(c,CARD_NEOS,78734254,false,false) Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_names={CARD_NEOS} s.material_setcode={SET_HERO,SET_ELEMENTAL_HERO,SET_NEOS,SET_NEO_SPACIAN} function s.contactfil(tp) return Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_ONFIELD,0,nil) end function s.contactop(g,tp) Duel.ConfirmCards(1-tp,g) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST|REASON_MATERIAL) end function s.splimit(e,se,sp,st) return not e:GetHandler():IsLocation(LOCATION_EXTRA) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_HAND) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) local sg=g:RandomSelect(tp,1) Duel.Destroy(sg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When you take 1000 or more battle or effect damage: You can Special Summon this card from your hand. You can target 1 monster in your opponent's GY, except a monster with ? ATK; your opponent can choose 1 monster from their Deck, except a monster with ? ATK. If they chose not to, or if the targeted monster has higher ATK than the chosen monster, Special Summon the targeted monster to your field, and if you do, shuffle the chosen monster back into the Deck. Otherwise, your opponent adds the chosen monster to the hand. You can only use each effect of "Millennium Seeker" once per turn.
--千年の血族 --Millennium Seeker --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_DAMAGE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special summon 1 monster from opponent's GY, or opponent adds 1 monster from deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.vartg) e2:SetOperation(s.varop) c:RegisterEffect(e2) end --If you took battle or effect damage function s.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and r&(REASON_BATTLE|REASON_EFFECT)~=0 and ev>=1000 end --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end --Special summon this card from hand 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 --Check for a non ? ATK monster to special summon function s.filter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetTextAttack()>=0 end --Activation legality function s.vartg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-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,0,LOCATION_GRAVE,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_DECK) end --Check for a non ? ATK monster to compare function s.thfilter(c) return c:IsMonster() and c:IsAbleToHand() and c:GetTextAttack()>=0 end --Special summon 1 monster from opponent's GY, or opponent adds 1 monster from deck function s.varop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local vc=tc:GetTextAttack() if not tc:IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.thfilter,tp,0,LOCATION_DECK,nil) if #g>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM) local sc=g:Select(1-tp,1,1,nil):GetFirst() Duel.ConfirmCards(1-tp,sc) if sc:GetTextAttack()<vc then Duel.ShuffleDeck(1-tp) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) else Duel.SendtoHand(sc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sc) Duel.ShuffleHand(1-tp) end else Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 Set Spell/Trap on the field; destroy it. 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 face-up Spell/Trap on the field; destroy it. You can only use this effect of "Galaxy Cyclone" once per turn.
--ギャラクシー・サイクロン --Galaxy Cyclone local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) e2:SetCondition(aux.exccon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.destg) e2:SetOperation(s.activate) c:RegisterEffect(e2) end function s.filter(c) return c:IsFacedown() and c:IsSpellTrap() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.filter(chkc) and chkc~=e:GetHandler() end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.filter2(c) return c:IsFaceup() and c:IsSpellTrap() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.filter2(chkc) and chkc~=e:GetHandler() end if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) 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 Wyrm monster's effect. If a monster is banished by card effect (except during the Damage Step): You can Special Summon this card from the GY (if it was there when the monster was banished) or hand (even if not), but banish it when it leaves the field. If this card is Special Summoned: You can target 1 card in the Field Zone and 1 monster your opponent controls or in their GY; banish them. You can only use each effect of "The Abyss Dragon Swordsoul" once per turn.
--深淵の相剣龍 --The Abyss Dragon Swordsoul --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableUnsummonable() --Must be Special Summoned by a Wyrm monster's effect local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetValue(s.splimit) c:RegisterEffect(e0) --Special Summon itself from the hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e1:SetCode(EVENT_REMOVE) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Banish two cards if it this card is Special Summoned local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end function s.splimit(e,se,sp,st) if not se:IsMonsterEffect() then return false end local rc=se:GetHandler() local trig_eff,trig_race=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_RACE) if trig_eff==se then if rc:IsRelateToEffect(se) then return rc:IsRace(RACE_WYRM) else return trig_race&RACE_WYRM>0 end else return rc:IsRace(RACE_WYRM) end end function s.spconfilter(c) return c:IsReason(REASON_EFFECT) and c:IsFaceup() and c:IsMonster() and (not c:IsPreviousLocation(LOCATION_ONFIELD) or c:GetPreviousTypeOnField()&TYPE_MONSTER>0) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.spconfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) 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 c:CompleteProcedure() --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end function s.rmfilter(c,e) return c:IsCanBeEffectTarget(e) and c:IsAbleToRemove() and (c:IsMonster() or c:IsLocation(LOCATION_FZONE)) end function s.rmrescon(sg,e,tp,mg) return sg:FilterCount(Card.IsLocation,nil,LOCATION_FZONE)==1 end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_FZONE,LOCATION_FZONE|LOCATION_MZONE|LOCATION_GRAVE,nil,e) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rmrescon,0) end local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rmrescon,1,tp,HINTMSG_REMOVE) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,2,tp,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg>0 then Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Majespecter" card in your Pendulum Zone; Special Summon it.
--マジェスペクター・ガスト --Majespecter Gust 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsSetCard(SET_MAJESPECTER) 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_PZONE) 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_PZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_PZONE,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:
If you control a Fiend monster: Target 1 card on the field; destroy it, then, you can send 1 Fiend monster from your Deck to the GY.
--悪魔の技 --Archfiend's Ghastly Glitch --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_DESTROY+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_ATTACK,TIMINGS_CHECK_MONSTER_E|TIMING_ATTACK) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_FIEND),tp,LOCATION_MZONE,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgfilter(c) return c:IsRace(RACE_FIEND) and c:IsAbleToGrave() end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tg=g:Select(tp,1,1,nil) if #tg==0 then return end Duel.BreakEffect() Duel.SendtoGrave(tg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is in your GY and you control 2 or more "Shiranui" monsters with different names: You can Special Summon this card, but banish it when it leaves the field. If this card is banished: You can target 1 Zombie monster you control; it gains 600 ATK until the end of this turn. You can only use each effect of "Shiranui Swordmaster" once per turn.
--不知火の師範 --Shiranui Swordmaster --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Special summon itself from GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Targeted zombie monster gains 600 ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_REMOVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.listed_series={SET_SHIRANUI} function s.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(SET_SHIRANUI) and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE,0,1,nil,c:GetCode()) end function s.cfilter2(c,code) return c:IsFaceup() and c:IsSetCard(SET_SHIRANUI) and not c:IsCode(code) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if 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: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 end function s.atkfilter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) 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_TARGET) Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp,chk) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(600) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can add 1 face-up Machine Pendulum Monster from your Extra Deck to your hand. If you have no Spells/Traps in your GY: You can Tribute this card; Special Summon 1 EARTH Machine monster with 1500 or less ATK from your hand or GY, except "Superheavy Samurai Security". You can only use each effect of "Superheavy Samurai Security" once per turn.
--超重武者ドウC-N --Superheavy Samurai Security --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Add to the hand 1 Pendulum monster from the Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) 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 1 EARTH Machine monster from hand or Graveyard local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.spcond) e3:SetCost(Cost.SelfTribute) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_names={id} function s.thfilter(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_PENDULUM) 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_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA) 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_EXTRA,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.spcond(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,LOCATION_GRAVE,0,1,nil) end function s.spfilter(c,e,tp) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) and c:IsAttackBelow(1500) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) 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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a Normal Monster. If it battles a monster with a higher Level, the equipped monster gains 500 ATK x the difference in Levels, during that damage calculation only. When this card is sent to the GY: You can place it on top of your Deck.
--下克上の首飾り --Amulet of Ambition local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsType,TYPE_NORMAL)) --atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCondition(s.atkcon) e2:SetValue(s.atkval) c:RegisterEffect(e2) --todeck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_TO_GRAVE) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) end function s.atkcon(e) if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end local eqc=e:GetHandler():GetEquipTarget() local bc=eqc:GetBattleTarget() return eqc:HasLevel() and bc and bc:GetLevel()>eqc:GetLevel() end function s.atkval(e,c) local bc=c:GetBattleTarget() return (bc:GetLevel()-c:GetLevel())*500 end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToDeck() end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKTOP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute Summon this card in Attack Position by Tributing 1 Zombie monster. When this card destroys a Zombie monster by battle and sends it to the GY: You can Special Summon that Zombie monster.
--真紅眼の不死竜 --Red-Eyes Zombie Dragon local s,id=GetID() function s.initial_effect(c) --summon with 1 tribute local e1=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.otfilter(c,tp) return c:IsRace(RACE_ZOMBIE) and (c:IsControler(tp) or c:IsFaceup()) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetAttacker() if c==tc then tc=Duel.GetAttackTarget() end e:SetLabelObject(tc) if not c:IsRelateToBattle() or c:IsFacedown() then return false end return tc:IsLocation(LOCATION_GRAVE) and tc:IsRace(RACE_ZOMBIE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetLabelObject() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end tc:CreateEffectRelation(e) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:IsRelateToEffect(e) and tc:IsRace(RACE_ZOMBIE) 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:
If an EARTH Machine monster is Tributed, or banished face-up: You can Special Summon this card from the GY (if it was there when the monster was Tributed or banished) or hand (even if not), but banish it when it leaves the field. You can only use this effect of "Infinitrack Road Roller" once per turn. An Xyz Monster whose original Type is Machine and has this card as material gains this effect. ● Face-up monsters your opponent controls are changed to Defense Position, also they lose 1000 DEF.
--無限起動ロードローラー --Infinitrack Road Roller --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself if an EARTH Machine monster is Tributed local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e1:SetCode(EVENT_RELEASE) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetLabel(0) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special Summon itself if an EARTH Machine monster is banished face-up local e2=e1:Clone() e2:SetCode(EVENT_REMOVE) e2:SetLabel(1) c:RegisterEffect(e2) --If attached to a Machine Xyz monster, monsters your opponent controls are changed to Defense Position local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_SET_POSITION) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetCondition(s.poscond) e3:SetTarget(function(_,c) return c:IsFaceup() end) e3:SetValue(POS_FACEUP_DEFENSE) c:RegisterEffect(e3) --If attached to a Machine Xyz monster, monsters your opponent controls lose 1000 DEF local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetCode(EFFECT_UPDATE_DEFENSE) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(0,LOCATION_MZONE) e4:SetCondition(s.poscond) e4:SetValue(-1000) c:RegisterEffect(e4) end function s.cfilter(c,label) if label==1 and c:IsFacedown() then return false end if c:IsPreviousLocation(LOCATION_MZONE) then return c:GetPreviousAttributeOnField()&ATTRIBUTE_EARTH>0 and c:GetPreviousRaceOnField()&RACE_MACHINE>0 else return c:IsMonster() and c:IsOriginalAttribute(ATTRIBUTE_EARTH) and c:IsOriginalRace(RACE_MACHINE) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,e:GetLabel()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end function s.poscond(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsOriginalRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) 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 banishing 1 Level 8 or lower Thunder monster from your hand or face-up field, during the turn a Thunder monster's effect was activated in the hand. Once per opponent's turn (Quick Effect): You can banish 2 cards from your GY, including a Thunder monster, then target 1 Thunder monster you control; your opponent cannot target it with card effects this turn. Once per turn, during your End Phase: You can send 1 "Thunder Dragon" card from your Deck to the GY.
--天雷震龍-サンダー・ドラゴン --Thunder Dragonlord --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Special summon procedure local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Targeted thunder monster cannot be targeted by opponent's card effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.tgcon) e2:SetCost(s.tgcost) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) --Send 1 "Thunder Dragon" card from deck to GY local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.gycon) e3:SetTarget(s.gytg) e3:SetOperation(s.gyop) c:RegisterEffect(e3) --Check if a thunder monster's effect was activated in hand Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) end s.listed_series={SET_THUNDER_DRAGON} function s.chainfilter(re,tp,cid) return not (re:IsMonsterEffect() and re:GetHandler():IsRace(RACE_THUNDER) and (Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_LOCATION)==LOCATION_HAND)) end function s.spfilter(c) return c:IsRace(RACE_THUNDER) and c:IsLevelBelow(8) and (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and c:IsAbleToRemoveAsCost() end function s.spcon(e,c) if c==nil then return true end local tp=e:GetHandlerPlayer() return (Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)~=0 or Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)~=0) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,c) end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,c) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.tgcheck(sg,e,tp) return sg:IsExists(Card.IsRace,1,nil,RACE_THUNDER) end function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,nil) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.tgcheck,0) end local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.tgcheck,1,tp,HINTMSG_REMOVE) Duel.Remove(sg,POS_FACEUP,REASON_COST) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_THUNDER) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_THUNDER),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_THUNDER),tp,LOCATION_MZONE,0,1,1,nil) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then --Cannot be targeted by opponent's card effects local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetDescription(3061) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetValue(aux.tgoval) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.gycon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.gyfilter(c) return c:IsSetCard(SET_THUNDER_DRAGON) and c:IsAbleToGrave() end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.gyfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.gyfilter,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:
FLIP: You can Special Summon 1 Level 3 or lower Beast monster from your Deck in face-down Defense Position.
--素早いビッグハムスター --Super-Nimble Mega Hamster local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) 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.filter(c,e,tp) return c:IsLevelBelow(3) and c:IsRace(RACE_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.ConfirmCards(1-tp,sg) end end