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 this card is activated: Shuffle this card from the field into the Deck. When this card in your possession is sent to your Graveyard by an opponent's card effect: Banish this card. If 3 of your "Jackpot 7" are currently banished, and were all banished by this effect, you win the Duel.
--ジャックポット7 --Jackpot 7 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Banish itself local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.rmcon) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end s.listed_names={id} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then c:CancelToGrave() Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local prev=c:GetPreviousControler() return prev==c:GetControler() and rp==1-prev and r&REASON_EFFECT~=0 and r&REASON_RETURN==0 end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) end function s.filter(c) return c:IsCode(id) and c:HasFlagEffect(id) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and not Duel.IsPlayerAffectedByEffect(c:GetControler(),CARD_SPIRIT_ELIMINATION) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,3,nil) then Duel.Win(tp,WIN_REASON_JACKPOT7) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Toss a coin and call it. If you call it right, banish all cards in your opponent's GY. If you call it wrong, send a number of cards from the top of your Deck to the GY, equal to the number of cards in your opponent's GY. * The above text is unofficial and describes the card's functionality in the OCG.
--デビル・コメディアン --Fiend Comedian local s,id=GetID() function s.initial_effect(c) --Toss a coin and banish cards from the opponent's GY or send cards from Deck to the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COIN+CATEGORY_REMOVE+CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.toss_coin=true function s.rmfilter(c) return c:IsAbleToRemove() and aux.SpElimFilter(c) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE) end Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_DECKDES,nil,1,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.CallCoin(tp) then Duel.Remove(Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,nil),POS_FACEUP,REASON_EFFECT) else Duel.DiscardDeck(tp,Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE),REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 2 DARK monsters with 0 DEF in your GY; add those targets to your hand.
--悪夢再び --Recurring Nightmare local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return c:IsDefenseBelow(0) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,2,2,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) if #sg>0 then Duel.SendtoHand(sg,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
At the start of the Damage Step, if your "P.U.N.K." monster battles an opponent's monster: You can destroy that opponent's monster. You can only use this effect of "Gagaku-P.U.N.K. Wild Picking" once per turn. If this card in its owner's Spell & Trap Zone is destroyed by an opponent's card effect: You can activate this effect; "P.U.N.K." monsters you currently control cannot be destroyed by battle this turn.
--ガガク-パンクワイルド・ピッキング --Gagaku-P.U.N.K. Wild Picking --scripted by Rundas 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) --Pop on attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_START) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) --Protect local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCondition(s.pcon) e3:SetOperation(s.pop) c:RegisterEffect(e3) end s.listed_series={SET_PUNK} --Pop on attack function s.descon(e,tp,eg,ep,ev,re,r,rp) local a,at=Duel.GetAttacker(),Duel.GetAttackTarget() if a:IsControler(1-tp) then a,at=at,a end return a and at and a:IsSetCard(SET_PUNK) and a:IsFaceup() and at:IsControler(1-tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local a,at=Duel.GetAttacker(),Duel.GetAttackTarget() if a:IsControler(1-tp) then a,at=at,a end Duel.SetOperationInfo(0,CATEGORY_DESTROY,at,1,1-tp,LOCATION_MZONE) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local a,at=Duel.GetAttacker(),Duel.GetAttackTarget() if a:IsControler(1-tp) then a,at=at,a end if at and at:IsRelateToBattle() and at:IsControler(1-tp) then Duel.Destroy(at,REASON_EFFECT) end end --Protect function s.pcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE) end function s.pop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_PUNK)) e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a Machine Fusion Monster. Your opponent cannot activate cards or effects during your Battle Phase. At the end of the Damage Step, if the equipped monster attacked an opponent's monster: You can banish 1 "Cyber Dragon" monster from your GY; the equipped monster can attack an opponent's monster again in a row. Your other monsters cannot attack the turn you activate this effect.
--エターナル・エヴォリューション・バースト --Super Strident Blaze --Script by dest local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Equip limit local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetValue(s.eqlimit) c:RegisterEffect(e2) --activate limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EFFECT_CANNOT_ACTIVATE) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(0,1) e3:SetCondition(s.actcon) e3:SetValue(1) c:RegisterEffect(e3) --chain attack local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetRange(LOCATION_SZONE) e4:SetCondition(s.cacon) e4:SetCost(s.cacost) e4:SetTarget(s.catg) e4:SetOperation(s.caop) c:RegisterEffect(e4) aux.GlobalCheck(s,function() s[0]=0 s[1]=0 local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_ATTACK_ANNOUNCE) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) aux.AddValuesReset(function() s[0]=0 s[1]=0 end) end) end s.listed_series={SET_CYBER_DRAGON} function s.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc:GetFlagEffect(id)==0 then s[ep]=s[ep]+1 tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end function s.eqlimit(e,c) return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION) end function s.eqfilter(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,e:GetHandler(),tc) end end function s.actcon(e) local ph=Duel.GetCurrentPhase() return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and Duel.IsBattlePhase() end function s.cacon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker()==e:GetHandler():GetEquipTarget() and Duel.GetAttackTarget()~=nil end function s.cafilter(c) return c:IsSetCard(SET_CYBER_DRAGON) and c:IsAbleToRemoveAsCost() end function s.cacost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.cafilter,tp,LOCATION_GRAVE,0,1,nil) and (s[tp]==0 or c:GetEquipTarget():GetFlagEffect(id)~=0) end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.ftarget) e1:SetLabel(c:GetEquipTarget():GetFieldID()) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cafilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() end function s.catg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetEquipTarget():CanChainAttack(0,true) end end function s.caop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ec=c:GetEquipTarget() if not ec:IsRelateToBattle() then return end Duel.ChainAttack() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE|PHASE_DAMAGE_CAL) ec:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 "Lunalight" monsters If this card is Fusion Summoned: You can add 1 "Luna Light Perfume" from your Deck to your hand. You can target 1 other "Lunalight" card you control; return it to the hand/Extra Deck, then you can Special Summon 1 "Lunalight" monster from your hand. You can banish this card from your GY; this turn, all monsters your opponent controls lose ATK equal to their original DEF. You can only use each effect of "Lunalight Perfume Dancer" once per turn.
--月光舞香姫 --Lunalight Perfume Dancer --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials: 2 "Lunalight" monsters Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_LUNALIGHT),2) --Add 1 "Luna Light Perfume" 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) e1:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Bounce and Special Summon 1 "Lunalight" monster from hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Apply an ATK reduction effect local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,2}) e3:SetCost(Cost.SelfBanish) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end s.listed_names={48444114} --"Luna Light Perfume" s.listed_series={SET_LUNALIGHT} function s.thfilter(c) return c:IsCode(48444114) 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,tp,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.tgfilter(c) return c:IsSetCard(SET_LUNALIGHT) and c:IsFaceup() and (c:IsAbleToHand() or c:IsAbleToExtra()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.tgfilter(chkc) and chkc~=c end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_ONFIELD,0,1,1,c) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_LUNALIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop(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|LOCATION_EXTRA) then Duel.ShuffleHand(tp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.BreakEffect() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() aux.RegisterClientHint(c,0,tp,0,1,aux.Stringid(id,4)) --This turn, monsters your opponent controls lose ATK equal to their own original DEF local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetValue(function(e,c) return -c:GetBaseDefense() end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Elemental HERO Burstinatrix" + "Elemental HERO Bubbleman" Must be Fusion Summoned. If this card destroys a monster by battle and sends it to the GY: Gain LP equal to that monster's original ATK in the GY.
--E・HERO スチーム・ヒーラー --Elemental HERO Steam Healer local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,58932615,79979666) --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) e1:SetValue(aux.fuslimit) c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(s.reccon) e2:SetTarget(s.rectg) e2:SetOperation(s.recop) c:RegisterEffect(e2) end s.material_setcode={SET_HERO,SET_ELEMENTAL_HERO} function s.reccon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() end function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local c=e:GetHandler() local bc=c:GetBattleTarget() local rec=bc:GetBaseAttack() if rec<0 then rec=0 end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(rec) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec) end function s.recop(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:
During your opponent's Battle Phase: Choose 2 Spells/Traps from your Deck and 1 monster in your Main Monster Zone. Special Summon them as Normal Monsters (ATK 0/DEF 0) in face-down Defense Position, Set the chosen monster if it is face-up, and shuffle them on the field. The 2 cards chosen from your Deck are destroyed at the end of the Battle Phase, and cannot remain on the field except during this Battle Phase.
--マジカルシルクハット --Magical Hats local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_BATTLE_END) 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.IsTurnPlayer(1-tp) and Duel.IsBattlePhase() end function s.filter(c) return c:GetSequence()<5 and not c:IsType(TYPE_TOKEN+TYPE_LINK) end function s.spfilter(c,e,tp) return c:IsSpellTrap() and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,TYPE_MONSTER|TYPE_NORMAL,0,0,0,0,0,POS_FACEDOWN) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end --Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if #g<2 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() if not tc or tc:IsImmuneToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,2,2,nil) if tc:IsFaceup() then if tc:IsHasEffect(EFFECT_LIGHT_OF_INTERVENTION) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) else Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) tc:ClearEffectRelation() end end local fid=e:GetHandler():GetFieldID() for tg in aux.Next(sg) do local e1=Effect.CreateEffect(tg) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(TYPE_NORMAL+TYPE_MONSTER) e1:SetReset(RESET_EVENT|RESET_TOGRAVE|RESET_REMOVE|RESET_TEMP_REMOVE|RESET_TOHAND|RESET_TODECK|RESET_OVERLAY) tg:RegisterEffect(e1,true) local e2=e1:Clone() e2:SetCode(EFFECT_REMOVE_RACE) e2:SetValue(RACE_ALL) tg:RegisterEffect(e2,true) local e3=e1:Clone() e3:SetCode(EFFECT_REMOVE_ATTRIBUTE) e3:SetValue(0xff) tg:RegisterEffect(e3,true) local e4=e1:Clone() e4:SetCode(EFFECT_SET_BASE_ATTACK) e4:SetValue(0) tg:RegisterEffect(e4,true) local e5=e1:Clone() e5:SetCode(EFFECT_SET_BASE_DEFENSE) e5:SetValue(0) tg:RegisterEffect(e5,true) tg:RegisterFlagEffect(id,RESET_EVENT|RESET_TOGRAVE|RESET_REMOVE|RESET_TEMP_REMOVE|RESET_TOHAND|RESET_TODECK|RESET_OVERLAY|RESET_PHASE|PHASE_BATTLE,0,1,fid) tg:SetStatus(STATUS_NO_LEVEL,true) end Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEDOWN_DEFENSE) Duel.ConfirmCards(1-tp,sg) sg:AddCard(tc) Duel.ShuffleSetCard(sg) sg:RemoveCard(tc) sg:KeepAlive() local de=Effect.CreateEffect(e:GetHandler()) de:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) de:SetCode(EVENT_PHASE|PHASE_BATTLE) de:SetReset(RESET_PHASE|PHASE_BATTLE) de:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) de:SetCountLimit(1) de:SetLabel(fid) de:SetLabelObject(sg) de:SetOperation(s.desop) Duel.RegisterEffect(de,tp) end function s.desfilter(c,fid) return c:GetFlagEffectLabel(id)==fid end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local fid=e:GetLabel() local tg=g:Filter(s.desfilter,nil,fid) g:DeleteGroup() Duel.Destroy(tg,REASON_EFFECT) local tg2=tg:Filter(s.desfilter,nil,fid) Duel.SendtoGrave(tg2,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Pay 500 Life Points to target 1 Level 4 or lower "Steelswarm" monster in your Graveyard; Special Summon it from the Graveyard.
--侵略の波紋 --Infestation Ripples local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCost(Cost.PayLP(500)) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_STEELSWARM} function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(SET_STEELSWARM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.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:
Fusion Summon 1 Fusion Monster from your Extra Deck, by banishing Fusion Materials mentioned on it from your GY face-down, but it cannot attack this turn.
--死魂融合 --Necro Fusion local s,id=GetID() function s.initial_effect(c) --Fusion summon 1 fusion monster by banishing monsters from GY, face-down, as material local e1=Fusion.CreateSummonEff(c,nil,s.matfilter,s.fextra,s.extraop,nil,s.stage2,nil,nil,nil,nil,nil,nil,nil,s.extratg) c:RegisterEffect(e1) end function s.matfilter(c,e,tp,check_or_run) return aux.SpElimFilter(c) and c:IsAbleToRemove(tp,POS_FACEDOWN) end function s.fextra(e,tp,mg) if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil) end return nil end function s.extraop(e,tc,tp,sg) Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) sg:Clear() end function s.stage2(e,tc,tp,sg,chk) if chk==1 then --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1,true) end end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
All monsters you control gain 300 ATK during your turn only. All monsters you control gain 300 DEF during your opponent's turn only.
--破邪の魔法壁 --Sorcerous Spell Wall local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCondition(s.atkcon) e2:SetValue(300) c:RegisterEffect(e2) --def local e3=e2:Clone() e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetCondition(s.defcon) c:RegisterEffect(e3) end function s.atkcon(e) return Duel.GetTurnPlayer()==e:GetHandlerPlayer() end function s.defcon(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute Summon this card in face-up Attack Position by Tributing 1 Reptile-Type "Worm" monster. Once per turn, you can Tribute 1 Reptile-Type "Worm" monster to Special Summon from your Deck 1 Reptile-Type "Worm" monster with a Level less than or equal to the Tributed monster.
--ワーム・クィーン --Worm Queen 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:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_WORM} function s.otfilter(c,tp) return c:IsSetCard(SET_WORM) and c:IsRace(RACE_REPTILE) and (c:IsControler(tp) or c:IsFaceup()) end function s.costfilter(c,e,tp,ft) return c:IsSetCard(SET_WORM) and c:IsRace(RACE_REPTILE) and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup()) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel()) end function s.spfilter(c,e,tp,lv) return c:IsSetCard(SET_WORM) and c:IsRace(RACE_REPTILE) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil,e,tp,ft) end local sg=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil,e,tp,ft) e:SetLabel(sg:GetFirst():GetLevel()) Duel.Release(sg,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_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,e:GetLabel()) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with "Mikanko Kagura". Cannot be destroyed by battle, also your opponent takes any battle damage you would have taken from battles involving this card. You can only use each of the following effects of "Ohime the Manifested Mikanko" once per turn. You can reveal this card in your hand; add 1 "Mikanko" card from your Deck to your hand, except "Ohime the Manifested Mikanko", then discard 1 card. (Quick Effect): You can target 1 Equip Spell in your GY; equip it to 1 appropriate monster on the field.
--オオヒメの御巫 --Ohime the Manifested Mikanko --Scripted by Hatter 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) --Reflect battle damage local e2=e1:Clone() e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) c:RegisterEffect(e2) --Search 1 "Mikanko" card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,id) e3:SetCost(Cost.SelfReveal) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) --Equip 1 Equip Spell local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_EQUIP) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_MZONE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e4:SetCountLimit(1,{id,1}) e4:SetTarget(s.eqtg) e4:SetOperation(s.eqop) c:RegisterEffect(e4) end s.listed_names={16310544,id} --"Mikanko Kagura" s.listed_series={SET_MIKANKO} function s.thfilter(c) return c:IsSetCard(SET_MIKANKO) and c:IsAbleToHand() and not c:IsCode(id) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil) end end function s.eqtcfilter(c,ec) return c:IsFaceup() and ec:CheckEquipTarget(c) end function s.eqfilter(c,tp) return c:IsEquipSpell() and c:CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(s.eqtcfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.eqfilter(chkc,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local ec=Duel.GetFirstTarget() if not ec:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local tc=Duel.SelectMatchingCard(tp,s.eqtcfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,ec):GetFirst() if tc then Duel.Equip(tp,ec,tc) 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 discard 1 card; apply the following effect, depending on the type of card discarded. ● Monster: Add 1 Trap from your GY to your hand. ● Spell: Add 1 monster from your GY to your hand. ● Trap: Add 1 Spell from your GY to your hand. You can only use this effect of "Mystrick Hulder" once per turn.
--幻姫フルドラ --Mystrick Hulder --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) end function s.cfilter(c,tp) if not c:IsDiscardable() then return false end local ty=c:GetMainCardType() local log=math.log(ty)/math.log(2) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,2 ^ ((log+2) % 3)) end function s.filter(c,ty) return c:IsType(ty) and c:IsAbleToHand() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp) local ty=g:GetFirst():GetMainCardType() local log=math.log(ty)/math.log(2) e:SetLabel(2 ^ ((log+2) % 3)) Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE,0,1,1,nil,e:GetLabel()) 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:
At the end of the Damage Step, when this card that was Tribute Summoned by Tributing an "Ancient Gear" monster battles an opponent's monster, but the opponent's monster was not destroyed by the battle: You can banish that opponent's monster. If this card was Tribute Summoned by Tributing a "Gadget" monster, it can attack all monsters your opponent controls, once each. If an "Ancient Gear" monster you control attacks, your opponent cannot activate Spell/Trap Cards and monster effects until the end of the Damage Step.
--古代の機械合成竜 --Ancient Gear Hydra local s,id=GetID() function s.initial_effect(c) --mat check local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MATERIAL_CHECK) e1:SetValue(s.valcheck) c:RegisterEffect(e1) --summon success local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(s.regcon) e2:SetOperation(s.regop) e2:SetLabelObject(e1) c:RegisterEffect(e2) --actlimit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EFFECT_CANNOT_ACTIVATE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,1) e3:SetValue(s.aclimit) e3:SetCondition(s.actcon) c:RegisterEffect(e3) end s.listed_series={SET_ANCIENT_GEAR,SET_GADGET} function s.valcheck(e,c) local g=c:GetMaterial() local flag=0 for tc in g:Iter() do if tc:IsSetCard(SET_ANCIENT_GEAR) then flag=(flag|0x1) end if tc:IsSetCard(SET_GADGET) then flag=(flag|0x2) end end e:SetLabel(flag) end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() end function s.regop(e,tp,eg,ep,ev,re,r,rp) local flag=e:GetLabelObject():GetLabel() local c=e:GetHandler() if (flag&0x1)~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_BATTLED) e1:SetOperation(s.atkregop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) end if (flag&0x2)~=0 then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ATTACK_ALL) e2:SetValue(1) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) end end function s.atkregop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetCondition(s.rmcon) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) e1:SetReset(RESET_PHASE|PHASE_DAMAGE) c:RegisterEffect(e1) end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local t=nil if ev==0 then t=Duel.GetAttackTarget() else t=Duel.GetAttacker() end e:SetLabelObject(t) return t and t:IsRelateToBattle() and e:GetHandler():IsStatus(STATUS_OPPO_BATTLE) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetLabelObject():IsAbleToRemove() end Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetLabelObject(),1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetLabelObject() if bc:IsRelateToBattle() then Duel.Remove(bc,POS_FACEUP,REASON_EFFECT) end end function s.aclimit(e,re,tp) return (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsMonsterEffect()) end function s.actcon(e) local tp=e:GetHandlerPlayer() local a=Duel.GetAttacker() return a and a:IsSetCard(SET_ANCIENT_GEAR) and a:IsControler(tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control no monsters, you can Special Summon this card (from your hand). When this card is Normal or Special Summoned: You can add 1 "Speedroid" monster from your Deck to your hand, except "Speedroid Terrortop". You can only use this effect of "Speedroid Terrortop" once per turn.
--SRベイゴマックス --Speedroid Terrortop local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetCountLimit(1,id) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_series={SET_SPEEDROID} s.listed_names={id} function s.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.thfilter(c) return c:IsSetCard(SET_SPEEDROID) and not c:IsCode(id) and c:IsMonster() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent's monster effect activated on the field resolves, they must discard 1 card or the effect is negated (their choice).
--氷結界の虎将 ライホウ --General Raiho of the Ice Barrier local s,id=GetID() function s.initial_effect(c) --When your opponent's monster effect activated on the field resolves, they must discard 1 card or the effect is negated local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetRange(LOCATION_MZONE) e1:SetOperation(s.handes) c:RegisterEffect(e1) end s[0]=0 function s.handes(e,tp,eg,ep,ev,re,r,rp) local trig_loc,chain_id=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_CHAIN_ID) if not (ep==1-tp and trig_loc==LOCATION_MZONE and chain_id~=s[0] and re:IsMonsterEffect()) then return end s[0]=chain_id if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,0)) then Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil) Duel.BreakEffect() else Duel.NegateEffect(ev) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can flip this card into face-down Defense Position. When this card is flipped face-up, you can return monsters your opponent controls to their owners' hand up to the number of face-up "Frog" monsters you control, except "Frog the Jam".
--裏ガエル --Flip Flop Frog local s,id=GetID() function s.initial_effect(c) --turn set local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_FLIP) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) c:RegisterEffect(e2) end s.listed_series={SET_FROG} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(id)==0 end c:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TURN_SET),0,1) Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE) end end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_FROG),tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_FROG),tp,LOCATION_MZONE,0,nil) if ct==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,ct,nil) Duel.HintSelection(g) Duel.SendtoHand(g,nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: Banish 1 Ritual Monster from your Deck. You can send this card to the GY, then activate 1 of these effects; ● Tribute 1 monster from your hand or field, or shuffle 1 Ritual Monster from your GY into the Deck, whose Level equals or exceeds the Level of the monster banished by this card's effect, then Ritual Summon that monster. ● Add the monster banished by this card's effect to your hand. You can only use 1 "Renewal of the World" effect per turn, and only once that turn.
--リターン・オブ・ザ・ワールド --Renewal of the World --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Ritual Summon or add to the hand local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetLabelObject(e1) e2:SetCost(s.cost) e2:SetTarget(s.target) c:RegisterEffect(e2) end function s.filter(c) return c:IsRitualMonster() and c:IsAbleToRemove() end function s.rmtg(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_REMOVE,nil,1,tp,LOCATION_DECK) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) e:SetLabelObject(tc) end end function s.cost(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.target(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetLabelObject():GetLabelObject() local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then if not tc or tc:IsFacedown() or tc:GetFlagEffect(id)==0 then return false end local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) and Duel.IsExistingMatchingCard(s.relfilter,tp,LOCATION_MZONE|LOCATION_HAND|LOCATION_GRAVE,0,1,tc,e,tp,tc,ft) local b2=tc:IsAbleToHand() return b1 or b2 end local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) and Duel.IsExistingMatchingCard(s.relfilter,tp,LOCATION_MZONE|LOCATION_HAND|LOCATION_GRAVE,0,1,tc,e,tp,tc,ft) local b2=tc:IsAbleToHand() local sel=0 if b1 and b2 then sel=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) elseif b1 then sel=Duel.SelectOption(tp,aux.Stringid(id,0)) else sel=Duel.SelectOption(tp,aux.Stringid(id,1))+1 end if sel==0 then e:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) e:SetOperation(s.spop) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) else e:SetCategory(CATEGORY_TOHAND) e:SetOperation(s.thop) Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0) end end function s.relfilter(c,e,tp,tc,ft) local lv=tc:GetLevel() aux.RitualSummoningLevel=lv local mlv=c:GetRitualLevel(tc) aux.RitualSummoningLevel=nil if not ((mlv&0xffff)>=lv or (mlv>>16)>=lv) then return false end if tc.mat_filter and not tc.mat_filter(c) or (tc.ritual_custom_check and not tc.ritual_custom_check(e,tp,Group.FromCards(c),tc)) then return false end if c:IsLocation(LOCATION_GRAVE) then return c:IsType(TYPE_RITUAL) and ft>0 and c:IsAbleToDeck() else return (ft>0 or c:IsControler(tp)) and c:IsReleasableByEffect(e) end end function s.spop(e,tp,eg,ep,ev,re,r,rp) local rc=e:GetLabelObject():GetLabelObject() if not rc or rc:IsFacedown() or rc:GetFlagEffect(id)==0 then return end if not rc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.relfilter),tp,LOCATION_MZONE|LOCATION_HAND|LOCATION_GRAVE,0,1,1,rc,e,tp,rc,ft):GetFirst() if tc then rc:SetMaterial(Group.FromCards(tc)) if tc:IsLocation(LOCATION_GRAVE) then if Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end else if Duel.Release(tc,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end end Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) rc:CompleteProcedure() end end function s.thop(e,tp,eg,ep,ev,re,r,rp) local rc=e:GetLabelObject():GetLabelObject() if not rc or rc:IsFacedown() or rc:GetFlagEffect(id)==0 then return end Duel.SendtoHand(rc,nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
All face-up WATER monsters you control gain 200 ATK. When this card is flipped face-up: Target 1 card your opponent controls; return that target to the hand.
--ペンギン・ナイトメア --Nightmare Penguin local s,id=GetID() function s.initial_effect(c) --return local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e1:SetCategory(CATEGORY_TOHAND) e1:SetCode(EVENT_FLIP) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER)) e2:SetValue(200) c:RegisterEffect(e2) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Main Phase (Quick Effect): You can Tribute 1 other Level 7 or higher monster from your hand; Special Summon this card from your hand, also you cannot Special Summon for the rest of this turn, except monsters with a Level. If this card is Special Summoned: You can Special Summon 1 "Ursarctic" monster from your hand, except "Ursarctic Mikbilis". You can only use each effect of "Ursarctic Mikbilis" once per turn.
--ベアルクティ-ミクビリス --Ursarctic Mikbilis local s,id=GetID() function s.initial_effect(c) --special summon c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_URSARCTIC} function s.spfilter(c,e,tp) return c:IsSetCard(SET_URSARCTIC) 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_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)<1 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:
Target 1 "Amazoness" monster you control and 1 face-up monster your opponent controls; switch the original ATK of those targets until the end of this turn.
--アマゾネスの呪詛師 --Amazoness Spellcaster local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_AMAZONESS} function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_AMAZONESS),tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_AMAZONESS),tp,LOCATION_MZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then local atk1=tc1:GetBaseAttack() local atk2=tc2:GetBaseAttack() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetValue(atk2) e1:SetReset(RESETS_STANDARD_PHASE_END) tc1:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SET_BASE_ATTACK) e2:SetValue(atk1) e2:SetReset(RESETS_STANDARD_PHASE_END) tc2:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 3 monsters During your Standby Phase: Detach 1 Xyz Material from this card or take 2000 damage. You cannot Special Summon any monsters. While this card has no Xyz Materials, it cannot attack.
--No.30 破滅のアシッド・ゴーレム --Number 30: Acid Golem of Destruction local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() --remove material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.rmcon) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCondition(s.atcon) c:RegisterEffect(e2) --disable spsummon local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,0) c:RegisterEffect(e3) end s.xyz_number=30 function s.atcon(e) return e:GetHandler():GetOverlayCount()==0 end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:GetHandler():GetOverlayCount()==0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000) end end function s.rmop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT) else Duel.Damage(tp,2000,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Offer your opponent a handshake. If they accept your handshake, each player's Life Points become half the combined Life Points of both players. If you have "Unity" in your hand and show it to your opponent, they must accept the handshake.
--友情 YU-JYO --Yu-Jo Friendship 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:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={14731897} --"Unity" function s.activate(e,tp,eg,ep,ev,re,r,rp) local opt=0 if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_HAND,0,1,nil,14731897) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_HAND,0,1,1,nil,14731897) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) opt=1 end if opt==0 then opt=Duel.SelectOption(1-tp,aux.Stringid(id,0),aux.Stringid(id,1)) else opt=Duel.SelectOption(1-tp,aux.Stringid(id,0)) end if opt==0 then local lp=(Duel.GetLP(tp)+Duel.GetLP(1-tp))/2 Duel.SetLP(tp,lp) Duel.SetLP(1-tp,lp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Warrior-Type monster you control attacks your opponent's monster, and the opponent's monster is not destroyed by battle, at the end of the Damage Step you can Special Summon this card from your hand. During battle between this attacking card and a Defense Position monster whose DEF is lower than the ATK of this card, inflict the difference as Battle Damage to your opponent.
--ソード・マスター --Sword Master local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --pierce local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_PIERCE) c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return d and Duel.IsTurnPlayer(tp) and a:IsRace(RACE_WARRIOR) and (d:IsRelateToBattle() or not d:IsReason(REASON_BATTLE)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send 1 other "Plunder Patroll" Monster Card from your hand or face-up field to the GY; Special Summon this card from your hand. If this card is in your GY: You can discard 1 card; Special Summon this card, but you cannot Special Summon for the rest of this turn, except "Plunder Patroll" monsters. You can only use each effect of "Goldenhair, the Newest Plunder Patroll" once per turn.
--海造賊-金髪の訓練生 --Goldenhair, the Newest Plunder Patroll --Scripted by pyrQ 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_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost1) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --Special summon itself from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.spcost2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end s.listed_series={SET_PLUNDER_PATROLL} function s.spcfilter(c,tp) return c:IsSetCard(SET_PLUNDER_PATROLL) and c:IsOriginalType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and Duel.GetMZoneCount(tp,c)>0 end function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spcfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=Duel.SelectMatchingCard(tp,s.spcfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,e:GetHandler(),tp) Duel.SendtoGrave(tc,REASON_COST) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,e:GetHandler():GetLocation()) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.spcost2(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.sptg2(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,e:GetHandler():GetLocation()) end function s.spop2(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) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,2)) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.splimit(e,c) return not c:IsSetCard(SET_PLUNDER_PATROLL) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control an "Evil Eye" monster, you can Special Summon this card (from your hand). You can only Special Summon "Basilius, Familiar of the Evil Eye" once per turn this way. During your Main Phase: You can send 1 "Evil Eye" Spell/Trap from your Deck to the GY. You can only use this effect of "Basilius, Familiar of the Evil Eye" once per turn.
--呪眼の眷属 バジリウス --Basilius, Familiar of the Evil Eye --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --send to grave local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_series={SET_EVIL_EYE} 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(aux.FaceupFilter(Card.IsSetCard,SET_EVIL_EYE),tp,LOCATION_MZONE,0,1,nil) end function s.tgfilter(c) return c:IsSpellTrap() and c:IsSetCard(SET_EVIL_EYE) and c:IsAbleToGrave() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card you control is destroyed by battle with an opponent's attacking monster and sent to your Graveyard: You can Special Summon 1 Warrior-Type monster with 1500 or less ATK from your Deck in Attack Position.
--朱雀の召喚士 --Red Sparrow Summoner 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_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp) end function s.filter(c,e,tp) return c:IsAttackBelow(1500) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Increase the DEF of all Defense Position monsters by 500 points.
--聖域の歌声 --Chorus of Sanctuary 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_FZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetTarget(aux.TargetBoolFunction(Card.IsDefensePos)) e2:SetValue(500) c:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Standby Phase: Gain 400 LP for each monster you control.
--白魔導士ピケル --White Magician Pikeru local s,id=GetID() function s.initial_effect(c) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return tp==Duel.GetTurnPlayer() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*400) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) Duel.Recover(p,ct*400,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Malefic" monster in your GY; Special Summon it, ignoring its Summoning conditions, but its effects are negated, also banish it during the End Phase.
--Sin Cross --Malefic Divide --Scripted by AlphaKretin, Tag Force version by anonymous local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_MALEFIC} function s.filter(c,e,tp) return c:IsSetCard(SET_MALEFIC) and c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,true,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) local fid=c:GetFieldID() tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetCountLimit(1) e3:SetLabel(fid) e3:SetLabelObject(tc) e3:SetCondition(s.rmcon) e3:SetOperation(s.rmop) Duel.RegisterEffect(e3,tp) end Duel.SpecialSummonComplete() end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:GetFlagEffectLabel(id)==e:GetLabel() then return true else e:Reset() return false end end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Dragon monster: Target 1 Spell/Trap on the field; destroy that target, and if you do, inflict 500 damage to its controller.
--スタンピング・クラッシュ --Stamping Destruction local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1: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_DRAGON),tp,LOCATION_MZONE,0,1,nil) end function s.filter2(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.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 function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then local p=tc:GetControler() if Duel.Destroy(tc,REASON_EFFECT)==0 then return end Duel.Damage(p,500,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned, except by Tributing 1 Normal Monster (but can be Normal Set). During your opponent's Main Phase (Quick Effect): You can reveal this card in your hand; immediately after this effect resolves, Normal Summon 1 "Primite" monster. You can only use this effect of "Primite Imperial Dragon" once per turn. If this card is Tribute Summoned: You can apply these effects in sequence. ● Negate the effects of all face-up monsters your opponent currently controls. ● Banish all monsters your opponent controls with the same Type or Attribute as a Normal Monster in your GY.
--原石竜インペリアル・ドラゴン --Primite Imperial Dragon --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Requires 1 Normal Monster Tribute to Normal Summon face-up local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_LIMIT_SUMMON_PROC) e0:SetCondition(s.selfnssumcon) e0:SetTarget(s.selfnssumtg) e0:SetOperation(s.selfnssumop) e0:SetValue(SUMMON_TYPE_TRIBUTE) c:RegisterEffect(e0) --Normal Summon 1 "Primoredial" monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e1:SetCountLimit(1,id) e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end) e1:SetCost(Cost.SelfReveal) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) c:RegisterEffect(e1) --Apply effects if it is Tribute Summoned local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(function(e) return e:GetHandler():IsTributeSummoned() end) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_series={SET_PRIMITE} function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.tributefilter,1,nil,tp) end function s.tributefilter(c,tp) return c:IsType(TYPE_NORMAL) and (c:IsControler(tp) or c:IsFaceup()) end function s.selfnssumcon(e,c) if c==nil then return true end local tp=c:GetControler() return aux.SelectUnselectGroup(Duel.GetReleaseGroup(tp),e,tp,1,1,s.rescon,0) end function s.selfnssumtg(e,tp,eg,ep,ev,re,r,rp,c) local g=aux.SelectUnselectGroup(Duel.GetReleaseGroup(tp),e,tp,1,1,s.rescon,1,tp,HINTMSG_RELEASE,nil,nil,Duel.IsSummonCancelable()) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.selfnssumop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end c:SetMaterial(g) Duel.Release(g,REASON_SUMMON|REASON_COST|REASON_MATERIAL) g:DeleteGroup() end function s.sumfilter(c) return c:IsSetCard(SET_PRIMITE) 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|LOCATION_MZONE,0,1,nil) end local g=Duel.GetMatchingGroup(s.sumfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,nil) Duel.SetOperationInfo(0,CATEGORY_SUMMON,g,1,tp,0) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local tc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil):GetFirst() if tc then Duel.Summon(tp,tc,true,nil) end end function s.rmvfilter(c,tp) return c:IsFaceup() and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.matchfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetRace(),c:GetAttribute()) end function s.matchfilter(c,race,att) return c:IsType(TYPE_NORMAL) and (c:IsRace(race) or c:IsAttribute(att)) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local disg=Duel.GetMatchingGroup(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,nil) local rmvg=Duel.GetMatchingGroup(s.rmvfilter,tp,0,LOCATION_MZONE,nil,tp) if chk==0 then return #disg>0 or #rmvg>0 end if #disg>0 then Duel.SetOperationInfo(0,CATEGORY_DISABLE,disg,#disg,tp,0) end if #rmvg>0 then Duel.SetOperationInfo(0,CATEGORY_REMOVE,rmvg,#rmvg,tp,0) end end function s.effop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local break_chk=false local disg=Duel.GetMatchingGroup(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,nil):Filter(Card.IsCanBeDisabledByEffect,nil,e) --Negate the effects of all face-up monsters your opponent controls for tc in disg:Iter() do tc:NegateEffects(c) Duel.AdjustInstantly(tc) break_chk=true end --Banish all monsters with the same Type/Attributes as Normal Monsters in your GY local rmvg=Duel.GetMatchingGroup(s.rmvfilter,tp,0,LOCATION_MZONE,nil,tp) if #rmvg>0 then if break_chk then Duel.BreakEffect() end Duel.Remove(rmvg,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control 3 or more face-up "Six Samurai" monsters, you can activate 1 of these effects: ● Destroy all face-up monsters your opponent controls. ● Destroy all face-up Spell/Trap Cards your opponent controls. ● Destroy all Set Spell/Trap Cards your opponent controls.
--六武式三段衝 --Six Strike - Triple Impact local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) end s.listed_series={SET_SIX_SAMURAI} function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_SIX_SAMURAI),tp,LOCATION_MZONE,0,3,nil) end function s.filter2(c) return c:IsFaceup() and c:IsSpellTrap() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) or Duel.IsExistingMatchingCard(s.filter2,tp,0,LOCATION_ONFIELD,1,nil) or Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end local t={} local p=1 if Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) then t[p]=aux.Stringid(id,0) p=p+1 end if Duel.IsExistingMatchingCard(s.filter2,tp,0,LOCATION_ONFIELD,1,nil) then t[p]=aux.Stringid(id,1) p=p+1 end if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) then t[p]=aux.Stringid(id,2) p=p+1 end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) local sel=Duel.SelectOption(tp,table.unpack(t))+1 local opt=t[sel]-aux.Stringid(id,0) local sg=nil if opt==0 then sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) elseif opt==1 then sg=Duel.GetMatchingGroup(s.filter2,tp,0,LOCATION_ONFIELD,nil) else sg=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0) e:SetLabel(opt) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local opt=e:GetLabel() local sg=nil if opt==0 then sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) elseif opt==1 then sg=Duel.GetMatchingGroup(s.filter2,tp,0,LOCATION_ONFIELD,nil) else sg=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil) end Duel.Destroy(sg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card cannot be Normal Summoned or Set. This card cannot be Special Summoned except by Tributing 1 "Ocean's Keeper". Your opponent must play with their hand revealed.
--サウザンド・アイズ・フィッシュ --Thousand-Eyes Jellyfish local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --public local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_PUBLIC) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_HAND) c:RegisterEffect(e3) end s.listed_names={45045866} function s.spcon(e,c) if c==nil then return true end return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,false,1,true,c,c:GetControler(),nil,false,nil,45045866) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,false,true,true,c,nil,nil,false,nil,45045866) if g then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 monster from your Deck to the GY.
--おろかな埋葬 --Foolish Burial local s,id=GetID() function s.initial_effect(c) --Send 1 monster to the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.tgfilter(c) return c:IsMonster() and c:IsAbleToGrave() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can send 1 WATER monster from your hand to the GY, then target 1 card in your opponent's GY; banish that target.
--水遁封印式 --Sealing Ceremony of Suiton local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) c:RegisterEffect(e1) --remove local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_REMOVE) e2:SetDescription(aux.Stringid(id,0)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1) e2:SetCost(s.rmcost) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() end function s.rmfilter(c) return c:IsAbleToRemove() and aux.SpElimFilter(c) end function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(cg,REASON_COST) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.rmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control no monsters and have this card in your hand: You can banish 1 other "Blackwing" monster from your hand; place 1 "Black Whirlwind" from your Deck face-up in your Spell & Trap Zone, then, either send this card to the GY, or immediately after this effect resolves, Normal Summon it without Tributing. You cannot Special Summon monsters from the Extra Deck for the rest of this turn, except DARK monsters. You can only use this effect of "Blackwing - Simoon the Poison Wind" once per turn. During the End Phase, if the "Black Whirlwind" placed by this effect is still on the field, send it to the GY, also take 1000 damage. * The above text is unofficial and describes the card's functionality in the OCG.
--BF-毒風のシムーン --Blackwing - Simoon the Poison Wind --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --Place 1 "Black Whirlwind" from your Deck face-up in your Spell & Trap Zone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SUMMON+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end) e1:SetCost(s.plcost) e1:SetTarget(s.pltg) e1:SetOperation(s.plop) c:RegisterEffect(e1) end s.listed_series={SET_BLACKWING} s.listed_names={91351370} --Black Whirlwind function s.cfilter(c) return c:IsSetCard(SET_BLACKWING) and c:IsMonster() and c:IsAbleToRemoveAsCost() end function s.plcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,c) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.plfilter(c,tp) return c:IsCode(91351370) and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then --Can be Normal Summoned without Tributes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCondition(s.ntcon) c:RegisterEffect(e1) local summonable=c:IsSummonable(true,e1) e1:Reset() return (summonable or c:IsAbleToGrave()) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetPossibleOperationInfo(0,CATEGORY_SUMMON,c,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,c,1,tp,0) end function s.ntcon(e,c,minc) if c==nil then return true end return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.plop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --Cannot Special Summon from the Extra Deck, except DARK monsters local e0=Effect.CreateEffect(c) e0:SetDescription(aux.Stringid(id,1)) e0:SetType(EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetTargetRange(1,0) e0:SetTarget(function(_e,_c) return _c:IsLocation(LOCATION_EXTRA) and not _c:IsAttribute(ATTRIBUTE_DARK) end) e0:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e0,tp) --Clock Lizard check aux.addTempLizardCheck(c,tp,function(_e,_c) return not _c:IsOriginalAttribute(ATTRIBUTE_DARK) end) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local tc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then --Send it to the GY during the End Phase and take 1000 damage aux.DelayedOperation(tc,PHASE_END,id,e,tp,s.gyop,nil,0,0,aux.Stringid(id,2)) if not c:IsRelateToEffect(e) then return end --Can be Normal Summoned without Tributes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCondition(s.ntcon) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) local b1=c:IsAbleToGrave() local b2=c:IsSummonable(true,e1) if not (b1 or b2) then e1:Reset() return end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,3)}, {b2,aux.Stringid(id,4)}) Duel.BreakEffect() if op==1 then Duel.SendtoGrave(c,REASON_EFFECT) else Duel.Summon(tp,c,true,e1) end end end function s.gyop(ag,e,tp,eg,ep,ev,re,r,rp) Duel.SendtoGrave(ag,REASON_EFFECT) Duel.Damage(tp,1000,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can target 1 "Utopia" monster you control; equip this monster from your hand or face-up field to that target. It gains 1300 ATK. While this card is equipped to a monster, your opponent cannot target that monster with card effects. If a monster equipped with this card would be destroyed by battle, destroy this card instead. You can only control 1 face-up "ZW - Tornado Bringer".
--ZW-風神雲龍剣 --ZW - Tornado Bringer local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_HAND|LOCATION_MZONE) e1:SetCondition(s.eqcon) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) aux.AddZWEquipLimit(c,s.eqcon,function(tc,c,tp) return s.filter(tc) and tc:IsControler(tp) end,s.equipop,e1) --cannot be target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) --destroy sub local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetCode(EFFECT_DESTROY_SUBSTITUTE) e3:SetValue(s.repval) c:RegisterEffect(e3) end s.listed_series={SET_UTOPIA} function s.eqcon(e) return e:GetHandler():CheckUniqueOnField(e:GetHandlerPlayer()) end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_UTOPIA) 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(tp) and s.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:GetControler()~=tp or not c:CheckUniqueOnField(tp) then Duel.SendtoGrave(c,REASON_EFFECT) return end s.equipop(c,e,tp,tc) end function s.equipop(c,e,tp,tc) if not aux.EquipAndLimitRegister(c,e,tp,tc) then return end --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1300) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) end function s.repval(e,re,r,rp) return (r&REASON_BATTLE)~=0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute 1 DARK monster from your hand or field; Special Summon this card from your hand. You can only use this effect of "Wicked Serpent Night Dragon" once per turn. When this card is destroyed by battle: You can target 1 monster your opponent controls; send it to the GY, then you can Special Summon this card.
--邪悪龍エビルナイト・ドラゴン --Wicked Serpent Night Dragon --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Send 1 monster your opponent controls to the GY, then you can Special Summon this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsAttribute,1,true,aux.ReleaseCheckMMZ,c,ATTRIBUTE_DARK) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectReleaseGroupCost(tp,Card.IsAttribute,1,1,true,aux.ReleaseCheckMMZ,c,ATTRIBUTE_DARK) Duel.Release(g,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,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsAbleToGrave() and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can target 1 monster your opponent controls; toss a coin 3 times and destroy it if at least 2 of the results are heads.
--リボルバー・ドラゴン --Barrel Dragon local s,id=GetID() function s.initial_effect(c) --Toss a coin and destroy 1 monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_COIN+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) end s.toss_coin=true function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local heads=Duel.CountHeads(Duel.TossCoin(tp,3)) if heads<2 then return end Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is also treated as a "Frightfur" monster while face-up on the field. This card on the field can be used as a substitute for any 1 Fusion Material whose name is specifically listed on a "Frightfur" Fusion Monster, but the other Fusion Material(s) must be correct.
--パッチワーク・ファーニマル --Patchwork Fluffal local s,id=GetID() function s.initial_effect(c) --setcode local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_ADD_SETCODE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(SET_FRIGHTFUR) c:RegisterEffect(e1) --fusion substitute local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_FUSION_SUBSTITUTE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetValue(s.subval) c:RegisterEffect(e2) end s.listed_series={SET_FRIGHTFUR} function s.subval(e,c) return c:IsSetCard(SET_FRIGHTFUR) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Reduce the Levels of all monsters your opponent controls by 1.
--デビリアン・ソング --Stygian Dirge local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) c:RegisterEffect(e1) --level local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_LEVEL) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetValue(-1) c:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control a Set card, your opponent cannot target this card with card effects, also it cannot be destroyed by your opponent's card effects. You can only use each of the following effects of "Lady Labrynth of the Silver Castle" once per turn. If a "Labrynth" card or effect or a Normal Trap Card was activated this turn, except "Lady Labrynth of the Silver Castle" (Quick Effect): You can Special Summon this card from your hand in Defense Position. When a Normal Trap Card is activated (Quick Effect): You can Set 1 Normal Trap with a different name directly from your Deck.
--迷宮城の白銀姫 --Lady Labrynth of the Silver Castle --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Cannot be targeted by the opponent's card effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.tgcond) e1:SetValue(aux.tgoval) c:RegisterEffect(e1) --Cannot be destroyed by the opponent's card effects local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetValue(aux.indoval) c:RegisterEffect(e2) --Special Summon itself in Defense position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_HAND) e3:SetHintTiming(TIMING_END_PHASE,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e3:SetCountLimit(1,id) e3:SetCondition(function() return Duel.GetCustomActivityCount(id,0,ACTIVITY_CHAIN)>0 or Duel.GetCustomActivityCount(id,1,ACTIVITY_CHAIN)>0 end) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) --Set 1 Normal Trap from the Deck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,{id,1}) e4:SetCondition(s.setcond) e4:SetTarget(s.settg) e4:SetOperation(s.setop) c:RegisterEffect(e4) --Check if a "Labrynth" card or effect or a Normal Trap Card was activated this turn Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.checkop) end s.listed_series={SET_LABRYNTH} s.listed_names={id} function s.tgcond(e) return Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end function s.checkop(re) local rc=re:GetHandler() return not ((rc:IsSetCard(SET_LABRYNTH) and not rc:IsCode(id)) or (re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsNormalTrap())) 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,POS_FACEUP_DEFENSE) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND) 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.setcond(e,tp,eg,ep,ev,re,r,rp) return re:GetActiveType()==TYPE_TRAP and re:IsHasType(EFFECT_TYPE_ACTIVATE) end function s.setfilter(c,code) return c:IsNormalTrap() and c:IsSSetable() and not c:IsCode(code) 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,re:GetHandler():GetCode()) 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,re:GetHandler():GetCode()) if #g>0 then Duel.SSet(tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 face-up monster your opponent controls; destroy that target, then your opponent gains 1000 LP.
--ソウルテイカー --Soul Taker local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER) 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) return c:IsFaceup() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,1000) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.BreakEffect() Duel.Recover(1-tp,1000,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
All monsters on the field lose 600 ATK, except "Vernusylph" monsters. You can discard this card, and 1 monster or 1 "Vernusylph" card; you cannot activate non-EARTH monster effects for the rest of this turn, also add 1 EARTH Fairy monster from your Deck to your hand, except "Vernusylph of the Misting Seedlings", then you can Special Summon 1 EARTH monster from your GY. You can only use this effect of "Vernusylph of the Misting Seedlings" once per turn.
--苗と霞の春化精 --Vernusylph of the Misting Seedlings --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Reduce ATK of non-"Vernalizer" monsters 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(function(_,c) return not c:IsSetCard(SET_VERNUSYLPH) end) e1:SetValue(-600) c:RegisterEffect(e1) --Search 1 EARTH Fairy monster c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,0,CATEGORY_TOHAND+CATEGORY_SEARCH,s.thtg,s.thop)) end s.listed_names={id} s.listed_series={SET_VERNUSYLPH} function s.thfilter(c) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_FAIRY) 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 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,g) return true end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: If it is the Main Phase: Apply these effects in sequence. ● Destroy all face-up monsters you control, except "Mimighoul" monsters. ● Give control of this card to your opponent. During your Main Phase: You can Special Summon this card from your hand to your opponent's field in face-down Defense Position. If this card is Normal or Special Summoned: You can add 1 "Mimighoul" Spell/Trap from your Deck to your hand. You can only use each effect of "Mimighoul Dragon" once per turn.
--ミミグル・ドラゴン --Mimighoul Dragon --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --FLIP: Apply these effects in sequence local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F) e1:SetCountLimit(1,id) e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) --Special Summon this card to your opponent's field in face-down Defense Position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.selfsptg) e2:SetOperation(s.selfspop) c:RegisterEffect(e2) --Add 1 "Mimighoul" Spell/Trap from your Deck to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,{id,2}) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end s.listed_series={SET_MIMIGHOUL} function s.desfilter(c) return c:IsFaceup() and not c:IsSetCard(SET_MIMIGHOUL) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local dg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,0,nil) if #dg>0 then Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,tp,0) end local c=e:GetHandler() if c:IsAbleToChangeControler() then Duel.SetOperationInfo(0,CATEGORY_CONTROL,c,1,tp,0) end end function s.effop(e,tp,eg,ep,ev,re,r,rp,chk) local break_chk=false --Destroy all face-up monsters you control, except "Mimighoul" monsters local dg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,0,nil) if #dg>0 then Duel.Destroy(dg,REASON_EFFECT) break_chk=true end --Give control of this card to your opponent local c=e:GetHandler() if c:IsRelateToEffect(e) then if break_chk then Duel.BreakEffect() end Duel.GetControl(c,1-tp) end end function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.selfspop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE) Duel.ConfirmCards(tp,c) end end function s.thfilter(c) return c:IsSetCard(SET_MIMIGHOUL) and c:IsSpellTrap() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Special Summon this card (from your hand) in Defense Position to your zone a Link Monster points to. You can only Special Summon "Crusadia Maximus" once per turn this way. You can target 1 "Crusadia" Link Monster you control; this turn, if it battles an opponent's monster, any battle damage it inflicts to your opponent is doubled, also other monsters you control cannot attack. You can only use this effect of "Crusadia Maximus" once per turn.
--天穹のパラディオン --Crusadia Maximus --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --You can Special Summon this card (from your hand) in Defense Position to your zone a Link Monster points to local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetTargetRange(POS_FACEUP_DEFENSE,0) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetValue(function(e,c) return 0,aux.GetMMZonesPointedTo(c:GetControler()) end) c:RegisterEffect(e1) --Apply a "this turn, if it battles an opponent's monster, any battle damage it inflicts to your opponent is doubled, also other monsters you control cannot attack" effect on 1 "Crusadia" Link Monster you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function() return Duel.IsAbleToEnterBP() end) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_series={SET_CRUSADIA} function s.tgfilter(c) return c:IsSetCard(SET_CRUSADIA) and c:IsLinkMonster() and c:IsFaceup() end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO) Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.effop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local c=e:GetHandler() local fid=tc:GetFieldID() --This turn, if it battles an opponent's monster, any battle damage it inflicts to your opponent is doubled local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e1:SetCondition(function(e) local bc=e:GetHandler():GetBattleTarget() return bc and bc:IsControler(1-e:GetHandlerPlayer()) end) e1:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) --Also other monsters you control cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(function(e,c) return fid~=c:GetFieldID() end) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time a Plant-Type monster(s) is Summoned, place 1 Plant Counter on this card (max. 5). You can send this card to the Graveyard to inflict 500 damage to your opponent for each Plant Counter on it.
--種子弾丸 --Seed Cannon local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(0x20) c:SetCounterLimit(0x20,5) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --add counter local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(s.ctcon) e2:SetOperation(s.ctop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) --damage local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,0)) e5:SetCategory(CATEGORY_DAMAGE) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_SZONE) e5:SetCost(s.damcost) e5:SetTarget(s.damtg) e5:SetOperation(s.damop) c:RegisterEffect(e5) end s.counter_place_list={0x20} function s.ctcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(aux.FaceupFilter(Card.IsRace,RACE_PLANT),1,nil) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():AddCounter(0x20,1) end function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end e:SetLabel(e:GetHandler():GetCounter(0x20)) Duel.SendtoGrave(e:GetHandler(),REASON_COST) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetCounter(0x20)>0 end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(e:GetLabel()*500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabel()*500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 1 "Ryu-Ge" monster from your hand, Deck, or GY, but return it to the hand during the End Phase. You can banish this card from your GY, then target 1 "Ryu-Ge" Continuous Spell in your banishment, GY, or field; place it on the bottom of the Deck, then draw 1 card. You can only use each effect of "Ryu-Ge Rivalry" once per turn.
--竜華三界流転 --Ryu-Ge Rivalry --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Ryu-Ge" monster from your hand, Deck, or GY, but return it to the hand during the End Phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND) 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) --Place 1 "Ryu-Ge" Continuous Spell you control or in your GY or banishment on the bottom of the Deck, then draw 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end s.listed_series={SET_RYU_GE} function s.spfilter(c,e,tp) return c:IsSetCard(SET_RYU_GE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then --Return it to the hand during the End Phase aux.DelayedOperation(sc,PHASE_END,id,e,tp,function(ag) Duel.SendtoHand(ag,nil,REASON_EFFECT) end,nil,0,0,aux.Stringid(id,2)) end end function s.tdfilter(c) return c:IsSetCard(SET_RYU_GE) and c:IsContinuousSpell() and c:IsAbleToDeck() and c:IsFaceup() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.tdfilter(chkc) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK) and Duel.IsPlayerCanDraw(tp) then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase: You can make all monsters currently on the field gain ATK equal to their own Level x 100, until the end of the opponent's turn. If this card in the hand or field is used as material for a Fusion Summon, and sent to the GY or banished: You can target 1 of your "Despia" monsters or Level 8 or higher Fusion Monsters, that is banished or in your GY, except "Ad Libitum of Despia"; Special Summon it. You can only use each effect of "Ad Libitum of Despia" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--デスピアの凶劇 --Ad Libitum of Despia --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Monsters on the field gain ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1,id) e1:SetRange(LOCATION_MZONE) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BE_MATERIAL) 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_DESPIA} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.HasLevel),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.HasLevel),tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #tg>0 then local c=e:GetHandler() for sc in aux.Next(tg) do --Increase ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_OPPO_TURN) e1:SetValue(sc:GetLevel()*100) sc:RegisterEffect(e1) end end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (r&REASON_FUSION)==REASON_FUSION and c:IsPreviousLocation(LOCATION_ONFIELD|LOCATION_HAND) and c:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and c:IsFaceup() end function s.spfilter(c,e,tp) return not c:IsCode(id) and (c:IsSetCard(SET_DESPIA) or (c:IsLevelAbove(8) and c:IsType(TYPE_FUSION))) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase: You can excavate the top cards of your Deck equal to the number of other "Valkyrie" monsters you control, and if you do, add 1 excavated Normal Spell/Trap to your hand, also send the remaining cards to the GY. Otherwise, shuffle all excavated cards into the Deck. When this card is destroyed by battle and sent to the GY: You can Special Summon 1 "Valkyrie" monster from your Deck. You can only use each effect of "Valkyrie Vierte" once per turn.
--ワルキューレ・フィアット --Valkyrie Vierte --Scripted by Naim local s,id=GetID() function s.initial_effect(c) --Excavate cards from your Deck, up to the number of "Valkyrie" monsters you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Special Summon 1 "valkyrie" monster from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcond) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_VALKYRIE} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,e:GetHandler()) if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end local g=Duel.GetDecktopGroup(tp,ct) return g:FilterCount(Card.IsAbleToHand,nil)>0 end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK) end function s.thfilter(c) return c:IsNormalSpell() or c:IsNormalTrap() end function s.operation(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,e:GetHandler()) Duel.ConfirmDecktop(tp,ct) local g=Duel.GetDecktopGroup(tp,ct) if #g>0 then Duel.DisableShuffleCheck() if g:IsExists(s.thfilter,1,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:FilterSelect(tp,s.thfilter,1,1,nil) if sg:GetFirst():IsAbleToHand() then Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) Duel.ShuffleHand(tp) else Duel.SendtoGrave(sg,REASON_RULE) end g:Sub(sg) Duel.SendtoGrave(g,REASON_EFFECT|REASON_EXCAVATE) end Duel.ShuffleDeck(tp) end end function s.spfilter1(c,e,tp) return c:IsSetCard(SET_VALKYRIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spcond(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) 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.spfilter1,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.spfilter1,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:
This card can be used to Ritual Summon any Reptile Ritual Monster. Activate 1 of these effects (but you can only use each effect of "Mitsurugi Ritual" once per turn); ● Ritual Summon 1 Reptile Ritual Monster from your Deck, by Tributing Reptile monsters from your hand or field whose total Levels equal the Level of the Ritual Monster. ● Ritual Summon 1 Reptile Ritual Monster from your hand, by Tributing up to 2 Reptile monsters from your hand, Deck, or field, whose total Levels equal the Level of the Ritual Monster.
--巳剣降臨 --Mitsurugi Ritual --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) end function s.deckmatfilter(c) return c:IsRace(RACE_REPTILE) and c:IsReleasableByEffect() end function s.extragroup(e,tp,eg,ep,ev,re,r,rp,chk) return Duel.GetMatchingGroup(s.deckmatfilter,tp,LOCATION_DECK,0,nil) end function s.extraop(mat,e,tp,eg,ep,ev,re,r,rp,tc) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_DECK) mat:Sub(mat2) Duel.ReleaseRitualMaterial(mat) Duel.SendtoGrave(mat2,REASON_EFFECT|REASON_MATERIAL|REASON_RITUAL|REASON_RELEASE) end function s.tributelimit(e,tp,g,sc) return #g<=2,#g>2 end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)} local params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,extraop=s.extraop,forcedselection=s.tributelimit} local b1=not Duel.HasFlagEffect(tp,id) and Ritual.Target(params1)(e,tp,eg,ep,ev,re,r,rp,0) local b2=not Duel.HasFlagEffect(tp,id+1) and Ritual.Target(params2)(e,tp,eg,ep,ev,re,r,rp,0) 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 Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) elseif op==2 then Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE|PHASE_END,0,1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_DECK) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then local params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)} Ritual.Operation(params1)(e,tp,eg,ep,ev,re,r,rp) elseif op==2 then local params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,extraop=s.extraop,forcedselection=s.tributelimit} Ritual.Operation(params2)(e,tp,eg,ep,ev,re,r,rp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Elemental HERO Neos" + "Neo-Spacian Flare Scarab" Must first be Special Summoned (from your Extra Deck) by shuffling the above cards you control into the Deck. (You do not use "Polymerization".) This card gains 400 ATK for each Spell/Trap Card on the field. During the End Phase: Shuffle this card into the Extra Deck.
--E・HERO フレア・ネオス --Elemental HERO Flare Neos local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,CARD_NEOS,89621922) Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit) aux.EnableNeosReturn(c) --atkup local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e5:SetCode(EFFECT_UPDATE_ATTACK) e5:SetRange(LOCATION_MZONE) e5:SetValue(s.atkval) c:RegisterEffect(e5) 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.atkval(e,c) return Duel.GetMatchingGroupCount(Card.IsSpellTrap,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*400 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(Quick Effect): You can target 1 face-up monster you control; equip this card from your hand to that target as an Equip Spell that gives that card 500 ATK. During the End Phase, if this card is in the GY because it was sent there this turn: You can add 1 FIRE Warrior monster, except "Infernoble Knight - Roland", or 1 Equip Spell from your Deck to your hand. You can only use each effect of "Infernoble Knight - Roland" once per turn.
--焔聖騎士-ローラン --Infernoble Knight - Roland --scripted by Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Equip from hand, quick-play 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_HAND) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetTarget(s.equiptg) e1:SetOperation(s.equipop) c:RegisterEffect(e1) --If sent to GY this turn 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) --Add 1 FIRE warrior/equip spell local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetCountLimit(1,{id,1}) e3:SetRange(LOCATION_GRAVE) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_names={id} --Part of "Noble Knight" archetype s.listed_series={SET_NOBLE_KNIGHT} --Activation legality function s.equiptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end --Equipping to a monster from hand, gain 500 ATK function s.equipop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) --ATK up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(500) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) end function s.eqlimit(e,c) return c==e:GetLabelObject() end --If sent to GY this turn, flag function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end --Check for FIRE warrior or equip spell function s.thfilter(c) return ((c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE)) or c:IsType(TYPE_EQUIP)) and c:IsAbleToHand() and not c:IsCode(id) end --Check for flag function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)>0 end --Activation legality 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 --Add FIRE warrior or equip spell 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:
[ Pendulum Effect ] Once per turn: You can pay 500 LP, then target 1 "D/D" monster you control; it gains 500 ATK (even if this card leaves the field). Unless you have a "D/D" card in your other Pendulum Zone, this card's Pendulum Scale becomes 5. ---------------------------------------- [ Monster Effect ] When this card is Normal Summoned: You can Special Summon 1 face-up DARK Pendulum Monster from your Extra Deck, but it has its effects negated, also you cannot Special Summon monsters for the rest of this turn, except "D/D" monsters.
--DDプラウド・オーガ --D/D Proud Ogre local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --atk local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetCost(Cost.PayLP(500)) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) --scale local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_CHANGE_LSCALE) e3:SetRange(LOCATION_PZONE) e3:SetCondition(s.sccon) e3:SetValue(5) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_CHANGE_RSCALE) c:RegisterEffect(e4) --spsummon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_SUMMON_SUCCESS) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) end s.listed_series={SET_DD} function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(SET_DD) 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_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) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end function s.sccon(e) return not Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),SET_DD) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_EXTRA,0,nil,e,tp) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) local tc=sg:GetFirst() Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) Duel.SpecialSummonComplete() 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,1)) e3:SetTargetRange(1,0) e3:SetTarget(s.splimit) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) end function s.splimit(e,c) return not c:IsSetCard(SET_DD) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is destroyed and sent to the GY: You can Special Summon 2 Normal Monsters with 0 ATK or DEF and different names from your Deck in Defense Position, but they cannot be used as Synchro Material, also they are destroyed during your next End Phase. You can only use this effect of "Box of Friends" once per turn.
--おもちゃ箱 --Box of Friends local s,id=GetID() function s.initial_effect(c) --Special summon 2 normal monsters, with 0 ATK or DEF and different names, from deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_DESTROY) end function s.filter1(c,e,tp) return c:IsType(TYPE_NORMAL) and (c:GetAttack()==0 or c:IsDefenseBelow(0)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return false end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return false end local g=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_DECK,0,nil,e,tp) return g:GetClassCount(Card.GetCode)>=2 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_DECK,0,nil,e,tp) if g:GetClassCount(Card.GetCode)>=2 then local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_SPSUMMON) local tc1=sg:GetFirst() local tc2=sg:GetNext() Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP_DEFENSE) tc1:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) tc2:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) --Cannot be used as synchro material local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3310) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc1:RegisterEffect(e1) local e2=e1:Clone() tc2:RegisterEffect(e2) Duel.SpecialSummonComplete() sg:KeepAlive() --Destroyed during next end phase local de=Effect.CreateEffect(e:GetHandler()) de:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) de:SetCode(EVENT_PHASE+PHASE_END) de:SetCountLimit(1) de:SetLabelObject(sg) de:SetCondition(s.descon) de:SetOperation(s.desop) if Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_END) then de:SetLabel(Duel.GetTurnCount()) de:SetReset(RESET_PHASE|PHASE_END|RESET_SELF_TURN,2) else de:SetLabel(0) de:SetReset(RESET_PHASE|PHASE_END|RESET_SELF_TURN) end Duel.RegisterEffect(de,tp) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() if not g:IsExists(s.desfilter,1,nil) then g:DeleteGroup() e:Reset() return false end return Duel.IsTurnPlayer(tp) and Duel.GetTurnCount()~=e:GetLabel() end function s.desfilter(c) return c:GetFlagEffect(id)>0 end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local tg=g:Filter(s.desfilter,nil) g:DeleteGroup() Duel.Destroy(tg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect. ● During your Main Phase: You can send 1 Gemini monster from your Deck to the Graveyard, then add 1 Gemini monster from your Deck to your hand. You can only use this effect of "Chemicritter Carbo Crab" once per turn.
--化合獣カーボン・クラブ --Chemicritter Carbo Crab local s,id=GetID() function s.initial_effect(c) Gemini.AddProcedure(c) --Send 1 Gemini monster to the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(Gemini.EffectStatusCondition) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) end function s.filter(c,tp) return s.tgfilter(c) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c) end function s.tgfilter(c) return c:IsType(TYPE_GEMINI) and c:IsAbleToGrave() end function s.thfilter(c) return c:IsType(TYPE_GEMINI) and c:IsAbleToHand() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #tg>0 then Duel.BreakEffect() Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Change 1 face-up Gemini monster you control to face-down Defense Position and negate the activation of an opponent's Spell Card, and destroy it.
--ヴィクティム・カウンター --Gemini Counter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_card_types={TYPE_GEMINI} function s.condition(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_GEMINI) and c:IsCanTurnSet() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then Duel.BreakEffect() if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Metalfoes" monster + 1 monster with 2500 or less ATK
--メタルフォーゼ・アダマンテ --Metalfoes Adamante 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.FilterBoolFunction(Card.IsAttackBelow,2500)) end s.listed_series={SET_METALFOES} s.material_setcode=SET_METALFOES
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While your opponent controls a Special Summoned monster and you control a Level 7 or higher "War Rock" monster, during Main Phase 1, neither player can activate the effects of monsters on the field. During your Main Phase: You can Set 1 "War Rock" Spell/Trap directly from your Deck, except "War Rock Medium", also you cannot Special Summon monsters for the rest of this turn, except Warrior monsters. You can only use this effect of "War Rock Medium" once per turn.
--ウォークライ・ミーディアム --War Rock Medium --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Cannot activate monster effects on the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(1,1) e2:SetCondition(s.limcon) e2:SetValue(s.limval) c:RegisterEffect(e2) --Set 1 "War Rock" Spell/Trap from your Deck 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.settg) e3:SetOperation(s.setop) c:RegisterEffect(e3) end s.listed_series={SET_WAR_ROCK} s.listed_names={id} function s.wrfilter(c) return c:IsFaceup() and c:IsLevelAbove(7) and c:IsSetCard(SET_WAR_ROCK) end function s.limcon(e) return Duel.IsPhase(PHASE_MAIN1) and Duel.IsExistingMatchingCard(s.wrfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsSummonType,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end function s.limval(e,re,tp) return re:GetActivateLocation()==LOCATION_MZONE and re:IsMonsterEffect() end function s.setfilter(c) return c:IsSetCard(SET_WAR_ROCK) and not c:IsCode(id) and c:IsSpellTrap() 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) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end 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:GetFirst()) end --Cannot Special Summon, except Warrior monsters 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 not c:IsRace(RACE_WARRIOR) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 card from your hand to the GY and activate 2 of these effects, in sequence; ● Add 1 "Reptilianne" monster from your Deck to your hand. ● Add 1 "Reptilianne" Spell/Trap from your Deck to your hand, except "Reptilianne Ramifications". ● Change the ATK of 1 monster your opponent controls to 0. You can only activate 1 "Reptilianne Ramifications" per turn.
--レプティレス・ラミフィケーション --Reptilianne Ramifications --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_REPTILIANNE} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST) end function s.mfilter(c) return c:IsMonster() and c:IsSetCard(SET_REPTILIANNE) and c:IsAbleToHand() end function s.mthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.mfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.stfilter(c) return c:IsSpellTrap() and c:IsSetCard(SET_REPTILIANNE) and not c:IsCode(id) and c:IsAbleToHand() end function s.stthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,nil) end e:SetCategory(e:GetCategory()+CATEGORY_ATKCHANGE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local b0=s.mthtg(e,tp,eg,ep,ev,re,r,rp,0) local b1=s.stthtg(e,tp,eg,ep,ev,re,r,rp,0) local b2=s.atktg(e,tp,eg,ep,ev,re,r,rp,0) if chk==0 then return b0 and (b1 or b2) or (b1 and b2) end local sel=0 for ct=1,2 do local stable={} local dtable={} if b0 and (sel&0x1==0) then table.insert(stable,0x1) table.insert(dtable,aux.Stringid(id,0)) end if b1 and (sel&0x2==0) then table.insert(stable,0x2) table.insert(dtable,aux.Stringid(id,1)) end if b2 and (sel&0x4==0) then table.insert(stable,0x4) table.insert(dtable,aux.Stringid(id,2)) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) local op=Duel.SelectOption(tp,table.unpack(dtable))+1 sel=sel+stable[op] end if (sel&0x1==0x1) then s.mthtg(e,tp,eg,ep,ev,re,r,rp,1) end if (sel&0x2==0x2) then s.stthtg(e,tp,eg,ep,ev,re,r,rp,1) end if (sel&0x4==0x4) then s.atktg(e,tp,eg,ep,ev,re,r,rp,1) end e:SetLabel(sel) end function s.mthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.mfilter,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.stthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.stfilter,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.atkop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local g=Duel.SelectMatchingCard(tp,Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,1,nil) if #g>0 then Duel.HintSelection(g,true) --ATK becomes 0 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) e1:SetReset(RESET_EVENT|RESETS_STANDARD) g:GetFirst():RegisterEffect(e1) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local sel=e:GetLabel() local ct=0 if (sel&0x1==0x1) then s.mthop(e,tp,eg,ep,ev,re,r,rp) Duel.BreakEffect() ct=ct+1 end if (sel&0x2==0x2) then s.stthop(e,tp,eg,ep,ev,re,r,rp) if ct==0 then Duel.BreakEffect() end end if (sel&0x4==0x4) then s.atkop(e,tp,eg,ep,ev,re,r,rp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card in its owner's possession is destroyed by an opponent's card: You can target 1 Level 4 or lower monster in your GY, except "Zombina"; Special Summon it.
--ゾンビーナ --Zombina local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_DESTROYED) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and e:GetHandler():IsPreviousControler(tp) end function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can target 1 "Dragunity" card in your Spell & Trap Zone; Special Summon it.
--ドラグニティ-ミリトゥム --Dragunity Militum local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_DRAGUNITY} function s.filter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_DRAGUNITY) 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_SZONE) 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_SZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,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:
Return all monsters you control to the hand.
--撤収命令 --Sound the Retreat! local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,nil) end local sg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,0,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,0,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the turn they are Special Summoned, Xyz Monsters you control cannot be destroyed by your opponent's card effects, also your opponent cannot target them with card effects. You can target 1 face-up Xyz Monster you control; it gains 300 ATK for each material currently attached to it, until the end of this turn, and if it does, and also has a material that is owned by your opponent, it can attack directly this turn (even if this card leaves the field). You can only use this effect of "Time Thief Hack" once per turn.
--クロノダイバー・ハック --Time Thief Hack --Scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --(The turn they were special summoned, your Xyz monsters) --Cannot be destroyed by opponent's card effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(s.target) e2:SetValue(aux.indoval) c:RegisterEffect(e2) --(The turn they were special summoned, your Xyz monsters) --Cannot be targeted by opponent's card effects local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(s.target) e3:SetValue(aux.tgoval) c:RegisterEffect(e3) --Targeted Xyz monster gains 300 ATK for each of its materials local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_SZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1,id) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) end function s.target(e,c) return c:IsType(TYPE_XYZ) and c:IsStatus(STATUS_SPSUMMON_TURN) end function s.filter(c) return c:IsFaceup() and c:GetOverlayCount()>0 end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.ownerfil(c,e) return c:GetOwner()~=e:GetHandlerPlayer() end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not c:IsRelateToEffect(e) or not tc then return end local value=tc:GetOverlayCount()*300 if tc:UpdateAttack(value,RESETS_STANDARD_PHASE_END,c)==value and tc:GetOverlayGroup():IsExists(s.ownerfil,1,nil,e) then --Can attack directly local e1=Effect.CreateEffect(c) e1:SetDescription(3205) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Any monster sent to the GY is banished instead.
--次元の裂け目 --Dimensional Fissure 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) --remove local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EFFECT_TO_GRAVE_REDIRECT) e2:SetRange(LOCATION_SZONE) e2:SetTarget(s.rmtarget) e2:SetTargetRange(0xff,0xff) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2) -- local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(id) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e3:SetTargetRange(0xff,0xff) e3:SetTarget(s.checktg) c:RegisterEffect(e3) end function s.rmtarget(e,c) return not c:IsLocation(LOCATION_OVERLAY) and not c:IsSpellTrap() end function s.checktg(e,c) return not c:IsPublic() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you do not control any face-up monsters, other than "Memento" monsters: You can Special Summon this card from your hand. During your Main Phase: You can destroy 1 "Memento" monster you control, and send any number of "Memento" monster(s) (with different names) from your Deck to the GY whose total Levels are less than or equal to the destroyed monster's original Level. You can only use each effect of "Mementotlan Tatsunootoshigo" once per turn.
--メメント・シーホース --Mementotlan Tatsunootoshigo --Scripted by Satellaa local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Send cards from the Deck to the GY with a total Levels equal to or lower than the destroyed monster's original Level local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_series={SET_MEMENTO} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) return g:FilterCount(Card.IsSetCard,nil,SET_MEMENTO)==#g end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.desfilter(c,tp) return c:IsSetCard(SET_MEMENTO) and c:IsFaceup() and c:HasLevel() and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,c:GetOriginalLevel()) end function s.tgfilter(c,lv) return c:IsSetCard(SET_MEMENTO) and c:IsMonster() and c:IsLevelBelow(lv) and c:IsAbleToGrave() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,0,nil,tp) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.rescon(lv) return function(sg,e,tp,mg) return sg:GetSum(Card.GetLevel)<=lv and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg end end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local tc=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst() if tc and Duel.Destroy(tc,REASON_EFFECT)>0 then local lv=tc:GetOriginalLevel() local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil,lv) local sg=aux.SelectUnselectGroup(g,e,tp,1,lv,s.rescon(lv),1,tp,HINTMSG_TOGRAVE,s.rescon(lv)) if #sg>0 then Duel.SendtoGrave(sg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent activates a monster effect as Chain Link 2 or higher (Quick Effect): You can make the activated effect become "Your opponent places 1 "Centur-Ion" monster from their face-up field or GY in their Spell & Trap Zone as a face-up Continuous Trap", also you cannot Special Summon "Centur-Ion Chimerea" for the rest of this turn. During the Main Phase, if this card is a Continuous Trap: You can Special Summon this card. You can only use each effect of "Centur-Ion Chimerea" once per turn.
--影騎士シメーリア --Centur-Ion Chimerea --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Change activated monster effect local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.chcon) e1:SetTarget(s.chtg) e1:SetOperation(s.chop) c:RegisterEffect(e1) --Special Summon this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,{id,1}) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e2:SetCondition(function(e) return Duel.IsMainPhase() and e:GetHandler():IsContinuousTrap() end) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_CENTURION} function s.chcon(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp and re:IsMonsterEffect() and Duel.GetCurrentChain(true)>=2 end function s.plfilter(c,tp) return c:IsSetCard(SET_CENTURION) and c:IsMonster() and c:IsFaceup() and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end end function s.plop(e,tp,eg,ep,ev,re,r,rp) local p=1-tp if Duel.GetLocationCount(p,LOCATION_SZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOFIELD) local tc=Duel.SelectMatchingCard(p,aux.NecroValleyFilter(s.plfilter),p,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp):GetFirst() if tc and Duel.MoveToField(tc,p,p,LOCATION_SZONE,POS_FACEUP,tc:IsMonsterCard()) then --Treat it as a Continuous Trap local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetValue(TYPE_TRAP|TYPE_CONTINUOUS) e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) tc:RegisterEffect(e1) end end function s.chop(e,tp,eg,ep,ev,re,r,rp) Duel.ChangeChainOperation(ev,s.plop) --Cannot Special Summon "Centur-Ion Chimerea" for the rest of this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(_,c) return c:IsCode(id) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this attacking card destroys an opponent's monster by battle: It can make a second attack during this Battle Phase. Once per turn, if you control this card that was not Summoned this turn: You can target up to 2 monsters your opponent controls; destroy them.
--竜王キング・レックス --Mighty Dino King Rex --Scripted by Satella local s,id=GetID() function s.initial_effect(c) --Make it be able to make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.atkcon) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Destroy up to 2 monsters your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(function(e) return not e:GetHandler():IsStatus(STATUS_SUMMON_TURN|STATUS_FLIP_SUMMON_TURN|STATUS_SPSUMMON_TURN) end) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker()==e:GetHandler() and aux.bdocon(e,tp,eg,ep,ev,re,r,rp) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsRelateToBattle() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (c:IsRelateToBattle() and c:IsRelateToEffect(e) and c:IsFaceup()) then return end --Can make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(3201) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e1) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal Summoned: Draw 1 card, show it, then send it to the GY unless it is a "Flower Cardian" monster. You can only use this effect of "Flower Cardian Pine" once per turn. If this card is destroyed by battle and sent to the GY, or if this card in your possession is destroyed by an opponent's card effect and sent to your GY: You can draw 1 card.
--花札衛-松- --Flower Cardian Pine local s,id=GetID() function s.initial_effect(c) --Draw 1 card, show it, then send it to the GY unless it is a "Flower Cardian" monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.nsdrtg) e1:SetOperation(s.nsdrop) c:RegisterEffect(e1) --Draw 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.desdrcon) e2:SetTarget(s.desdrtg) e2:SetOperation(s.desdrop) c:RegisterEffect(e2) end s.listed_series={SET_FLOWER_CARDIAN} function s.nsdrtg(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) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end function s.nsdrop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Draw(p,d,REASON_EFFECT)>0 then local dc=Duel.GetOperatedGroup():GetFirst() Duel.ConfirmCards(1-tp,dc) if not (dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster()) then Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end end function s.desdrcon(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_DESTROY) and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)) end function s.desdrtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.desdrop(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 Tribute Summon a DARK Normal Monster, you can treat this 1 monster as 2 Tributes.
--ダークフレーム --Dark Effigy local s,id=GetID() function s.initial_effect(c) --double tribute local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DOUBLE_TRIBUTE) e1:SetValue(s.condition) c:RegisterEffect(e1) end function s.condition(e,c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_NORMAL) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
For the rest of this Duel, apply the following effects. ● You cannot activate monster effects in the hand. ● Monsters you control can make up to 2 attacks on monsters during each Battle Phase. ● If your monster battles an opponent's monster, any battle damage it inflicts to your opponent is doubled. You can banish this card from your GY; add 1 "Morganite" card from your Deck to your hand, then place 1 card from your hand on the bottom of the Deck.
--死を謳う魔瞳 --Succumbing-Song Morganite --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Apply effects for the rest of the Duel local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Add 1 "Morganite" card from your Deck to your hand, then place 1 card from your hand on the bottom of the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_MORGANITE} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.HasFlagEffect(tp,id) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.HasFlagEffect(tp,id) then return end Duel.RegisterFlagEffect(tp,id,0,0,1) local c=e:GetHandler() --You cannot activate monster effects in the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(s.aclimit) Duel.RegisterEffect(e1,tp) --Your monsters can make up to 2 attacks on monsters during each Battle Phase local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetValue(1) Duel.RegisterEffect(e2,tp) --If your monster battles an opponent's monster, any battle damage it inflicts to your opponent is doubled local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(s.doubledmgtg) e3:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) Duel.RegisterEffect(e3,tp) end function s.aclimit(e,re,tp) local rc=re:GetHandler() return rc and rc:IsLocation(LOCATION_HAND) and re:IsMonsterEffect() end function s.doubledmgtg(e,c) local bc=c:GetBattleTarget() return bc and bc:IsControler(1-e:GetHandlerPlayer()) end function s.thfilter(c) return c:IsSetCard(SET_MORGANITE) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local hg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #hg==0 or Duel.SendtoHand(hg,nil,REASON_EFFECT)==0 then return end Duel.ConfirmCards(1-tp,hg) Duel.ShuffleHand(tp) Duel.ShuffleDeck(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil) if #dg>0 then Duel.BreakEffect() Duel.SendtoDeck(dg,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is used to Ritual Summon "Zera the Mant". You must also Tribute monsters from your hand or field whose total Levels equal 8 or more.
--ゼラの儀式 --Zera Ritual local s,id=GetID() function s.initial_effect(c) Ritual.AddProcGreaterCode(c,8,nil,69123138) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can increase the Level of 1 face-up Insect-Type monster you control by 2, until the End Phase.
--ダーク・スパイダー --Dark Spider local s,id=GetID() function s.initial_effect(c) --lv up local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsLevelAbove(1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(2) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Banish any number of "Branded" Spells/Traps from your GY; Special Summon that many "Iceblade Tokens" (Dragon/DARK/Level 8/ATK 2500/DEF 2000). You can banish this card from your GY, then target 1 of your banished monsters that is "Fallen of Albaz" or mentions it; add that monster to your hand. You can only use 1 "Branded Sword" effect per turn, and only once that turn.
--烙印の剣 --Branded Sword --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+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Return 1 banished "Fallen of Albaz" or monster that lists it to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_names={CARD_ALBAZ,id+1} s.listed_series={SET_BRANDED} function s.cfilter(c) return c:IsSetCard(SET_BRANDED) and c:IsSpellTrap() and c:IsAbleToRemoveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) local bg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return #bg>0 and ft>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2500,2000,8,RACE_DRAGON,ATTRIBUTE_DARK) end ft=math.min(ft,#bg) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,ft,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) e:SetLabel(#g) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local res=e:GetLabel()~=0 e:SetLabel(0) return res end local ct=e:GetLabel() Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local ct=e:GetLabel() if Duel.GetLocationCount(tp,LOCATION_MZONE)<ct or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2500,2000,8,RACE_DRAGON,ATTRIBUTE_DARK) then return end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and ct>1 then return end for i=1,ct do local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) end Duel.SpecialSummonComplete() end function s.thfilter(c) return c:IsFaceup() and (c:IsCode(CARD_ALBAZ) or (c:IsMonster() and c:ListsCode(CARD_ALBAZ))) 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_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then Duel.ConfirmCards(1-tp,tc) 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. This card can attack directly. Once per turn, during damage calculation, if your monster battles an opponent's monster, while this card is co-linked (Quick Effect): You can make that opponent's monster's ATK 0 during that damage calculation only. Once per turn, during damage calculation, if this monster that is not co-linked battles an opponent's monster (Quick Effect): You can make that opponent's monster's ATK 0 during that damage calculation only.
--扇風機塊プロペライオン --Appliancer Propelion --scripted by pyrQ 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) --Direct attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e2) --0 ATK while co-linked local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e3:SetCountLimit(1) e3:SetCondition(s.atkcon) e3:SetOperation(s.atkop) c:RegisterEffect(e3) --0 ATK while not co-linked local e4=e3:Clone() e4:SetCondition(s.atkcon2) c:RegisterEffect(e4) end function s.lkcon(e) local c=e:GetHandler() return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsLinkSummoned() end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local b=Duel.GetAttackTarget() if not b then return false end if a:IsControler(1-tp) then a,b=b,a end if e:GetHandler():GetMutualLinkedGroupCount()>0 and a:IsControler(tp) and b:IsControler(1-tp) and Duel.IsPhase(PHASE_DAMAGE_CAL) then return true else return false end end function s.atkcon2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local a=Duel.GetAttacker() local b=Duel.GetAttackTarget() if not b then return false end if a:IsControler(1-tp) then a,b=b,a end if c:GetMutualLinkedGroupCount()==0 and a==c and b:IsControler(1-tp) and Duel.IsPhase(PHASE_DAMAGE_CAL) then return true else return false end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetAttacker() local bc=Duel.GetAttackTarget() if bc:IsControler(1-tp) then bc,tc=tc,bc end if tc and tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(1-tp) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL) e1:SetValue(0) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Increase the ATK of all LIGHT monsters by 500 points and decrease their DEF by 400 points.
--シャインスパーク --Luminous Spark local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT)) e2:SetValue(500) c:RegisterEffect(e2) --Def down local e3=e2:Clone() e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetValue(-400) c:RegisterEffect(e3) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be destroyed by battle. If this card was Normal Summoned, during the Standby Phase of the Summoning player's next turn: You can Tribute this card; Special Summon up to 3 Level 4 or lower Reptile and/or Rock monsters from your hand and/or Deck, but banish them during the End Phase. (If you Special Summon 2 or more monsters, they must have the same name.) You can only use this effect of "Reptia Egg" once per turn.
--レプティア・エッグ --Reptia Egg --Scripted by Naim local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) c:RegisterEffect(e1) --Register local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetOperation(s.nsreg) c:RegisterEffect(e2) 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:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetCondition(s.spcon) e3:SetCost(Cost.SelfTribute) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) e3:SetLabelObject(e2) c:RegisterEffect(e3) end function s.nsreg(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_STANDBY) then e:SetLabel(Duel.GetTurnCount()) c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,2) else e:SetLabel(0) c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,1) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and Duel.IsTurnPlayer(tp) and e:GetHandler():GetFlagEffect(id)>0 end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsRace(RACE_ROCK|RACE_REPTILE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND) end function s.rescon(sg,e,tp,mg) return sg:GetClassCount(Card.GetCode)==1 end function s.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end if ft>3 then ft=3 end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,nil,e,tp) local sg=aux.SelectUnselectGroup(g,e,tp,1,ft,s.rescon,1,tp,HINTMSG_SPSUMMON) if #sg>0 then local fid=e:GetHandler():GetFieldID() for tc in aux.Next(sg) do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) tc:RegisterFlagEffect(id+1,RESETS_STANDARD_PHASE_END,0,1,fid) end Duel.SpecialSummonComplete() sg:KeepAlive() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCountLimit(1) e1:SetLabel(fid) e1:SetLabelObject(sg) e1:SetCondition(s.rmcon) e1:SetOperation(s.rmop) Duel.RegisterEffect(e1,tp) end end function s.rmfilter(c,fid) return c:GetFlagEffectLabel(id+1)==fid end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() if not g:IsExists(s.rmfilter,1,nil,e:GetLabel()) then g:DeleteGroup() e:Reset() return false else return true end end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local tg=g:Filter(s.rmfilter,nil,e:GetLabel()) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When you take battle damage: Draw 1 card. If this card in its owner's control is destroyed by an opponent's card effect: You can draw cards, equal to the number of "Dig of Destiny" in your Graveyard.
--運命の発掘 --Dig of Destiny local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY) e2:SetCondition(s.drcon) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return ep==tp end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function s.drcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp~=tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,id) if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(ct) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetMatchingGroupCount(Card.IsCode,p,LOCATION_GRAVE,0,nil,id) Duel.Draw(p,ct,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time a "Shaddoll" monster(s) is sent to the GY by a card effect, place 1 Spellstone Counter on this card for each sent monster. All monsters your opponent controls lose 100 ATK for each Spellstone Counter on this card during your opponent's turn only. Each time you Fusion Summon a "Shaddoll" Fusion Monster, you can remove 3 Spellstone Counters from this card to use 1 appropriate face-up monster your opponent controls as 1 of the Fusion Materials.
--影牢の呪縛 --Curse of the Shadow Prison local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(0x16) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --counter local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_TO_GRAVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_FZONE) e2:SetCondition(s.ctcon) e2:SetOperation(s.ctop) c:RegisterEffect(e2) --atkdown local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_FZONE) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetCondition(s.atkcon) e3:SetValue(s.atkval) c:RegisterEffect(e3) --chain material local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_CHAIN_MATERIAL) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetRange(LOCATION_FZONE) e4:SetTargetRange(1,0) e4:SetCondition(s.chcon) e4:SetTarget(s.chtg) e4:SetOperation(s.chop) e4:SetValue(aux.FilterBoolFunction(Card.IsSetCard,SET_SHADDOLL)) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetOperation(s.chk) e4:SetLabelObject(e5) end s.counter_place_list={0x16} s.listed_series={SET_SHADDOLL} function s.cfilter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsMonster() and c:IsReason(REASON_EFFECT) end function s.ctcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local ct=eg:FilterCount(s.cfilter,nil) e:GetHandler():AddCounter(0x16,ct) end function s.atkcon(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end function s.atkval(e,c) return e:GetHandler():GetCounter(0x16)*-100 end function s.chcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetCounter(0x16)>=3 end function s.chfilter(c,e,tp) return c:IsMonster() and (c:IsFaceup() or c:IsControler(tp)) and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) end function s.chtg(e,te,tp,value) if value&SUMMON_TYPE_FUSION==0 then return Group.CreateGroup() end return Duel.GetMatchingGroup(s.chfilter,tp,LOCATION_MZONE|LOCATION_HAND,LOCATION_MZONE,nil,te,tp) end function s.chop(e,te,tp,tc,mat,sumtype,sg,sumpos) if not sumtype then sumtype=SUMMON_TYPE_FUSION end tc:SetMaterial(mat) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) if mat:IsExists(Card.IsControler,1,nil,1-tp) then e:GetHandler():RemoveCounter(tp,0x16,3,REASON_EFFECT) end Duel.BreakEffect() if sg then sg:AddCard(tc) else Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,sumpos) end end function s.chk(tp,sg,fc) return sg:FilterCount(Card.IsControler,nil,1-tp)<=1 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate only when a Reptile-Type monster you control is destroyed. Special Summon 1 Level 4 or lower Reptile-Type monster from your Deck.
--スネーク・ホイッスル --Snake Whistle local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c,tp) return c:IsRace(RACE_REPTILE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsRace(RACE_REPTILE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a "tellarknight" monster you control. It gains 500 ATK and DEF, also it is unaffected by your opponent's card effects. If you control a face-up monster that is not a "tellarknight" monster, destroy this card.
--星輝士の因子 --Stellarknight Alpha local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,0,aux.FilterBoolFunction(Card.IsSetCard,SET_TELLARKNIGHT),s.eqlimit) --atk/def local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetValue(500) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e4) --immune local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_EQUIP) e5:SetCode(EFFECT_IMMUNE_EFFECT) e5:SetValue(s.efilter) c:RegisterEffect(e5) --selfdes local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetCode(EFFECT_SELF_DESTROY) e6:SetRange(LOCATION_SZONE) e6:SetCondition(s.descon) c:RegisterEffect(e6) end s.listed_series={SET_TELLARKNIGHT} function s.eqlimit(e,c) return c:IsSetCard(SET_TELLARKNIGHT) and c:GetControler()==e:GetHandler():GetControler() end function s.efilter(e,re) return e:GetHandlerPlayer()~=re:GetOwnerPlayer() end function s.cfilter(c) return c:IsFaceup() and not c:IsSetCard(SET_TELLARKNIGHT) end function s.descon(e) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish this card from your Graveyard; take 1 Xyz Material from a monster your opponent controls and attach it to an Xyz Monster you control as Xyz Material.
--オーバーレイ・イーター --Overlay Eater local s,id=GetID() function s.initial_effect(c) -- local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g1=Duel.GetOverlayGroup(tp,0,1) local g2=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) if #g1==0 or #g2==0 then return end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local mg=g1:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local tc=g2:Select(tp,1,1,nil):GetFirst() local oc=mg:GetFirst():GetOverlayTarget() Duel.Overlay(tc,mg) Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Select and see 1 card in your opponent's hand.
--未熟な密偵 --The Inexperienced Spy local s,id=GetID() function s.initial_effect(c) --confirm local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.cftg) e1:SetOperation(s.cfop) c: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 Duel.SetTargetPlayer(tp) end function s.cfop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(p,nil,p,0,LOCATION_HAND,1,1,nil) if #g>0 then Duel.ConfirmCards(p,g) Duel.ShuffleHand(1-p) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Spells and Traps sent from the field to your opponent's GY are banished instead. You can only use each of the following effects of "General Wayne of the Ice Barrier" once per turn. If your opponent controls a monster and you control an "Ice Barrier" monster: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can add 1 "Ice Barrier" Spell/Trap from your Deck to your hand.
--氷結界の虎将 ウェイン --General Wayne of the Ice Barrier --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) --Banish S/T sent to your opponent's GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EFFECT_TO_GRAVE_REDIRECT) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD) e1:SetValue(LOCATION_REMOVED) e1:SetTarget(s.rmtg) c:RegisterEffect(e1) --Special Summon itself from your 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) --Add IB S/T on Normal/Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end s.listed_series={SET_ICE_BARRIER} function s.rmtg(e,c) return c:GetOwner()~=e:GetHandlerPlayer() and c:IsOriginalType(TYPE_SPELL+TYPE_TRAP) and Duel.IsPlayerCanRemove(e:GetHandlerPlayer(),c) end function s.spfilter(c) return c:IsSetCard(SET_ICE_BARRIER) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetMatchingGroupCount(s.spfilter,tp,LOCATION_MZONE,0,nil)>0 end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.thfilter(c) return c:IsSetCard(SET_ICE_BARRIER) and c:IsSpellTrap() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Send the top 5 cards of your opponent's Deck to the Graveyard.
--ニードルワーム --Needle Worm local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) 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 true end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,5) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.DiscardDeck(1-tp,5,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned: You can target 1 Tuner in your GY; Special Summon it in Defense Position, but negate its effects. You can only use this effect of "Martial Metal Marcher" once per turn. A Synchro Monster that used this card as material is treated as a Tuner while face-up on the field.
--武力の軍奏 --Martial Metal Marcher -- local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --add tuner local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(s.tncon) e2:SetOperation(s.tnop) c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSynchroSummoned() end function s.spfilter(c,e,tp) return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end Duel.SpecialSummonComplete() end function s.tncon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_SYNCHRO end function s.tnop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the Graveyard by a card effect: You can target 1 Normal Monster in your Graveyard; add that target to your hand.
--ジェムナイト・ラズリー --Gem-Knight Lazuli local s,id=GetID() function s.initial_effect(c) --Add 1 Normal Monster from your GY to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end function s.thfilter(c) return c:IsType(TYPE_NORMAL) 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,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Your opponent draws 3 cards. Both players look at the cards. If there are any Spell Cards among them, discard all those Spell Card(s) to the Graveyard.
--悪魔の偵察者 --Hiro's Shadow Scout local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) 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 true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(3) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,3) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Draw(p,d,REASON_EFFECT)==0 then return end Duel.BreakEffect() local g=Duel.GetOperatedGroup() Duel.ConfirmCards(1-p,g) local dg=g:Filter(Card.IsSpell,nil) Duel.SendtoGrave(dg,REASON_EFFECT|REASON_DISCARD) Duel.ShuffleHand(p) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can Tribute 1 other monster; this card gains 1000 ATK until the end of this turn. If this card attacks, change it to Defense Position at the end of the Battle Phase. Once while this card is in your GY, when you draw a monster during your Draw Phase: You can show it to your opponent; Special Summon it. This card must be in the GY to activate and to resolve this effect. * The above text is unofficial and describes the card's functionality in the OCG.
--D-HERO ダッシュガイ --Destiny HERO - Dasher local s,id=GetID() function s.initial_effect(c) --Increase ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(s.atkcost) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Change it to Defense Position local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE|PHASE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.poscon) e2:SetOperation(s.posop) 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_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e3:SetCode(EVENT_DRAW) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) 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,nil,1,false,nil,c) end local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,c) Duel.Release(g,REASON_COST) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) then return end --Increase ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end function s.poscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetAttackedCount()>0 end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsAttackPos() then Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and Duel.IsPhase(PHASE_DRAW) and Duel.IsTurnPlayer(tp) end function s.spfilter(c,e,tp) return c:IsLocation(LOCATION_HAND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(s.spfilter,1,nil,e,tp) end if #eg==1 then Duel.ConfirmCards(1-tp,eg) Duel.ShuffleHand(tp) Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,eg,1,0,0) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=eg:FilterSelect(tp,s.spfilter,1,1,nil,e,tp) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end 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:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Special Summon 1 "Evolsaur" monster from your Deck.
--エヴォルド・ウェストロ --Evoltile Westlo local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FLIP+EFFECT_TYPE_SINGLE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_EVOLSAUR} function s.filter(c,e,tp) return c:IsSetCard(SET_EVOLSAUR) and c:IsCanBeSpecialSummoned(e,151,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,151,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 1 "Atlantean" or "Mermail" monster from your hand or GY, and if you do, equip it with this card. If the equipped monster would be destroyed by battle or card effect, you can send this card to the GY instead. You can banish this card from your GY, then target up to 3 of your Fish, Sea Serpent, and/or Aqua monsters that are banished or in your GY; shuffle them into the Deck. You can only use this effect of "Abyss-sting Triaina" once per turn. You can only activate 1 "Abyss-sting Triaina" per turn.
--アビスティング-トリアイナ --Abyss-sting Triaina --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Atlantean" or "Mermail" monster from your hand or GY, and if you do, equip it with this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --If the equipped monster would be destroyed by battle or card effect, you can send this card to the GY instead local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetTarget(s.replacetg) c:RegisterEffect(e2) --Shuffle up to 3 of your 3 Fish, Sea Serpent, and/or Aqua monsters from your GY or banishment into your Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end s.listed_series={SET_ATLANTEAN,SET_MERMAIL} function s.spfilter(c,e,tp) return c:IsSetCard(s.listed_series) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() if not tc then return end local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 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==tc end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) end end function s.replacetg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local ec=c:GetEquipTarget() if chk==0 then return ec:IsReason(REASON_BATTLE|REASON_EFFECT) and not ec:IsReason(REASON_REPLACE) and c:IsAbleToGrave() and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end if Duel.SelectEffectYesNo(tp,c,96) then Duel.SendtoGrave(c,REASON_EFFECT) return true else return false end end function s.tdfilter(c) return c:IsRace(RACE_FISH|RACE_SEASERPENT|RACE_AQUA) and c:IsFaceup() and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and s.tdfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,3,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg>0 then Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can target 2 Level 6 or lower monsters with the same name on the field; their Levels are doubled. At the start of the Battle Phase: You can target 1 "Cipher" monster you control; choose 1 other face-up monster on the field, and its name becomes that "Cipher" monster's, until the End Phase. You can only use each effect of "Double Exposure" once per turn.
--拡散光波 --Double Exposure --Scripted by Eerie Code, based on the anime version 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) --double level local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.lvtg) e2:SetOperation(s.lvop) c:RegisterEffect(e2) --name change local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE|PHASE_BATTLE_START) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.nmtg) e3:SetOperation(s.nmop) c:RegisterEffect(e3) end s.listed_series={SET_CIPHER} function s.lvfilter(c,e) return c:IsFaceup() and c:IsLevelBelow(6) and c:IsCanBeEffectTarget(e) end function s.lvcheck(sg,e,tp,mg) return sg:GetClassCount(Card.GetCode)==1 end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.lvcheck,0) end local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.lvcheck,1,tp,HINTMSG_FACEUP) Duel.SetTargetCard(sg) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tg=Duel.GetTargetCards(e):Filter(Card.IsFaceup,nil) for tc in aux.Next(tg) do --Double their Levels local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL_FINAL) e1:SetValue(tc:GetLevel()*2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end function s.nmfilter2(c,cd) return c:IsFaceup() and not c:IsCode(cd) end function s.nmfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CIPHER) and Duel.IsExistingMatchingCard(s.nmfilter2,0,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetCode()) end function s.nmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.nmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.nmfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.nmfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.nmop(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 not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local sg=Duel.SelectMatchingCard(tp,s.nmfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,tc,tc:GetCode()) if #sg>0 then Duel.HintSelection(sg) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(tc:GetCode()) sg:GetFirst():RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you Tribute Summon this card by Tributing a WIND monster, return all Spell and Trap Cards on the field to the owners' hands.
--疾風鳥人ジョー --Swift Birdman Joe 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_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --tribute check local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetValue(s.valcheck) e2:SetLabelObject(e1) c:RegisterEffect(e2) end function s.valcheck(e,c) local g=c:GetMaterial() if g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND) then e:GetLabelObject():SetLabel(1) else e:GetLabelObject():SetLabel(0) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() and e:GetLabel()==1 end function s.filter(c) return 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_ONFIELD,LOCATION_ONFIELD,1,nil) end local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can attack your opponent directly. When this card inflicts Battle Damage to your opponent by a direct attack, select 1 face-up monster on the field and remove it from play until the End Phase of this turn.
--エレキジ --Wattpheasant local s,id=GetID() function s.initial_effect(c) --direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e1) --act limit local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BATTLE_DAMAGE) 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) return ep~=tp and Duel.GetAttackTarget()==nil end function s.filter(c) return c:IsFaceup() and c:IsAbleToRemove() 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_REMOVE) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,tc:GetPosition(),REASON_EFFECT|REASON_TEMPORARY)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetLabelObject(tc) e1:SetCountLimit(1) e1:SetOperation(s.retop) Duel.RegisterEffect(e1,tp) 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:
Cannot be Normal Summoned, unless you control a "Ghostrick" monster. Once per turn: You can change this card to face-down Defense Position. When a "Ghostrick" monster is destroyed by an opponent's card effect, or by battle with their attacking monster, and sent to your GY: You can Special Summon this card from your hand in face-down Defense Position, and if you do, draw 1 card.
--ゴーストリック・スペクター --Ghostrick Specter local s,id=GetID() function s.initial_effect(c) --summon limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCondition(s.sumcon) c:RegisterEffect(e1) --turn set local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.postg) e2:SetOperation(s.posop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_HAND) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_GHOSTRICK} function s.sumcon(e) return not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_GHOSTRICK),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(id)==0 end c:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TURN_SET),0,1) Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE) end end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY) and c:GetReasonPlayer()~=tp and c:IsSetCard(SET_GHOSTRICK) and c:IsMonster() and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and c==Duel.GetAttackTarget())) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) 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,false,false,POS_FACEDOWN_DEFENSE)~=0 then Duel.ConfirmCards(1-tp,c) Duel.Draw(tp,1,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 face-up "Neo-Spacian" monster you control to the Graveyard. Special Summon 1 Level 4 monster with the same name from your Extra Deck.
--NEX --NEX 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:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_NEO_SPACIAN} function s.filter1(c,e,tp) local code=c:GetCode() return c:IsFaceup() and c:IsSetCard(SET_NEO_SPACIAN) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,code,e,tp,c) end function s.filter2(c,code,e,tp,mc) return c:IsCode(code) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter1(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc1=Duel.GetFirstTarget() if tc1 and tc1:IsRelateToEffect(e) and Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 and tc1:IsLocation(LOCATION_GRAVE) then local code=tc1:GetCode() local tc2=Duel.GetFirstMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,nil,code,e,tp,tc1) if tc2 and Duel.SpecialSummon(tc2,0,tp,tp,true,false,POS_FACEUP)~=0 then tc2:CompleteProcedure() end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, when your opponent activates a monster effect (Quick Effect): You can make this card gain ATK equal to that opponent's monster's original ATK until the end of this turn. You can only use each of the following effects of "Noh-P.U.N.K. Ogre Dance" once per turn. You can Tribute 1 "P.U.N.K." monster; Special Summon this card from your hand. You can send this card from your hand or field to the GY; add 1 "P.U.N.K." monster from your Deck to your hand, except a Level 8 monster.
--No-P.U.N.K.オーガ・ナンバー --Noh-P.U.N.K. Ogre Dance --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Gain ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Special Summon self local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Search local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND|LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.SelfToGrave) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_PUNK} function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsMonsterEffect() and re:GetHandler():GetBaseAttack()>0 end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local atk=re:GetHandler():GetBaseAttack() if c:IsFaceup() and c:IsRelateToEffect(e) and atk>0 and re:GetHandler():IsControler(1-tp) then --Update ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(atk) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsSetCard,1,false,aux.ReleaseCheckMMZ,nil,SET_PUNK) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectReleaseGroupCost(tp,Card.IsSetCard,1,1,false,aux.ReleaseCheckMMZ,nil,SET_PUNK) Duel.Release(g,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.thfilter(c) return c:IsMonster() and c:IsSetCard(SET_PUNK) and not c:IsLevel(8) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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:
Once per turn, during the End Phase, if this card destroyed an opponent's monster by battle and sent it to the GY this turn while you controlled it: You can target 1 of those destroyed monsters in the GY; Special Summon that target.
--ブレイン・クラッシャー --Brain Crusher local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetOperation(s.regop) c:RegisterEffect(e2) end function s.regop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)~=0 end function s.filter(c,e,tp,rc,tid) return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid 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 s.filter(chkc,e,tp,e:GetHandler(),Duel.GetTurnCount()) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) 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