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:
[ Pendulum Effect ] Once per turn, if your opponent controls a monster whose current ATK is higher than its original ATK: You can gain 1000 LP. ---------------------------------------- [ Monster Effect ] When this card declares an attack: You can make this card gain 1000 ATK for each monster on the field whose current ATK is higher than its original ATK, except other monsters you control, until the end of the Battle Phase. If this card is destroyed by battle or card effect while its current ATK is higher than its original ATK: You can target 1 monster in your Graveyard; Special Summon it. You can only use 1 monster effect of "Performapal Laugh Maker" per turn, and only once that turn.
--EMラフメイカー --Performapal Laugh Maker local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1) e1:SetCondition(s.rccon) e1:SetTarget(s.rctg) e1:SetOperation(s.rcop) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCountLimit(1,id) e2:SetCondition(s.atkcon) e2:SetOperation(s.atkop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,id) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end function s.rcfilter(c) return c:IsFaceup() and c:GetAttack()>c:GetBaseAttack() end function s.rccon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.rcfilter,tp,0,LOCATION_MZONE,1,nil) end function s.rctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000) end function s.rcop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return s.rcfilter(e:GetHandler()) or Duel.IsExistingMatchingCard(s.rcfilter,tp,0,LOCATION_MZONE,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToBattle() or c:IsFacedown() then return end local ct=Duel.GetMatchingGroupCount(s.rcfilter,tp,0,LOCATION_MZONE,nil) if s.rcfilter(c) then ct=ct+1 end if ct>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000*ct) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e1) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_EFFECT|REASON_BATTLE) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousAttackOnField()>c:GetBaseAttack() end function s.spfilter(c,e,tp) return 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 chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) 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:
Each face-up monster your opponent controls loses 100 ATK x its own Level.
--強者の苦痛 --Burden of the Mighty 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 down local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetValue(s.val) c:RegisterEffect(e2) end function s.val(e,c) return c:GetLevel()*-100 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned, put 3 counters on it. This card cannot be destroyed by battle. If this card attacks or is attacked, remove 1 counter from this card at the end of the Damage Step. If you cannot, destroy it. Once per turn, you can remove 1 counter on this card to destroy 1 Spell or Trap Card on the field.
--巨大戦艦 テトラン --B.E.S. Tetran local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(0x1f) --summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.addct) e1:SetOperation(s.addc) c:RegisterEffect(e1) --battle indestructable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(1) c:RegisterEffect(e2) --remove counter local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_DAMAGE_STEP_END) e3:SetCondition(s.rctcon) e3:SetOperation(s.rctop) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCondition(s.descon) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) --destroy local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,3)) e5:SetCategory(CATEGORY_DESTROY) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1) e5:SetCost(s.descost2) e5:SetTarget(s.destg2) e5:SetOperation(s.desop2) c:RegisterEffect(e5) end function s.addct(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,3,0,0x1f) end function s.addc(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then e:GetHandler():AddCounter(0x1f,3) end end function s.rctcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetCounter(0x1f)~=0 end function s.rctop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then c:RemoveCounter(tp,0x1f,1,REASON_EFFECT) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetCounter(0x1f)==0 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then Duel.Destroy(c,REASON_EFFECT) end end function s.descost2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1f,1,REASON_COST) end e:GetHandler():RemoveCounter(tp,0x1f,1,REASON_COST) end function s.filter(c) return c:IsSpellTrap() end function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can target 1 Cyberse monster in your GY, except "ROM Cloudia"; add it to your hand. If this card is destroyed by battle or card effect: You can Special Summon 1 Level 4 or lower Cyberse monster from your Deck, except "ROM Cloudia".
--ROMクラウディア --ROM Cloudia local s,id=GetID() function s.initial_effect(c) --tohand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={id} function s.thfilter(c) return c:IsRace(RACE_CYBERSE) and c:IsAbleToHand() and not c:IsCode(id) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return (r&REASON_EFFECT+REASON_BATTLE)~=0 end function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Battle Phase, if you control a "Silent Magician" monster, and have more cards in your hand than your opponent: Each player draws until they have 6 cards in their hand. This card's activation and effect cannot be negated. You can banish this card from your Graveyard; add 1 "Silent Magician" monster from your Deck to your hand.
--サイレント・バーニング --Silent Burning local s,id=GetID() function s.initial_effect(c) --Each player draws until they have 6 cards in their hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) e1:SetHintTiming(TIMING_BATTLE_PHASE,TIMING_BATTLE_START|TIMING_BATTLE_PHASE|TIMING_BATTLE_STEP_END|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER) c:RegisterEffect(e1) --Add 1 "Silent Magician" monster from your Deck to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_SILENT_MAGICIAN} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsBattlePhase() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_SILENT_MAGICIAN),tp,LOCATION_MZONE,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ct1=6-Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,e:GetHandler()) local ct2=6-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) if chk==0 then return ct1>0 and Duel.IsPlayerCanDraw(tp,ct1) and ct2>0 and Duel.IsPlayerCanDraw(1-tp,ct2) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,ct1+ct2) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local turn_player=Duel.GetTurnPlayer() local ct1=6-Duel.GetFieldGroupCount(turn_player,LOCATION_HAND,0) local ct2=6-Duel.GetFieldGroupCount(turn_player,0,LOCATION_HAND) if ct1>0 then Duel.Draw(turn_player,ct1,REASON_EFFECT) end if ct2>0 then Duel.Draw(1-turn_player,ct2,REASON_EFFECT) end end function s.thfilter(c) return c:IsSetCard(SET_SILENT_MAGICIAN) 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:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by Tributing 1 "The Legendary Fisherman". When this card is Special Summoned: You can banish all monsters your opponent controls, also this card cannot attack this turn. Cannot be destroyed by battle or card effects, also unaffected by Spell/Trap effects. Once per turn: You can return as many of your opponent's banished cards as possible to their GY, and if you do, the first battle or effect damage your opponent takes this turn becomes doubled.
--伝説のフィッシャーマン三世 --The Legendary Fisherman III local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Must be special summoned by its own method local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --Special summon procedure (from hand) 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) --Banish all of opponent's monsters local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) c:RegisterEffect(e3) --Cannot be destroyed by battle or card effect local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetValue(1) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e5) --Unaffected by spell/trap effects local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetRange(LOCATION_MZONE) e6:SetCode(EFFECT_IMMUNE_EFFECT) e6:SetValue(s.efilter) c:RegisterEffect(e6) --Return all of opponent's banished cards to GY local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_IGNITION) e7:SetRange(LOCATION_MZONE) e7:SetCountLimit(1) e7:SetTarget(s.damtg) e7:SetOperation(s.damop) c:RegisterEffect(e7) end s.listed_names={3643300} 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,3643300) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,false,true,true,c,nil,nil,false,nil,3643300) if g then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil) if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end end function s.efilter(e,te) return te:IsSpellTrapEffect() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_REMOVED)>0 end local g=Duel.GetFieldGroup(tp,0,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_REMOVED) if Duel.SendtoGrave(g,REASON_EFFECT|REASON_RETURN)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(0,1) e1:SetValue(s.damval) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(0,1) e2:SetValue(DOUBLE_DAMAGE) e2:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL|PHASE_END) Duel.RegisterEffect(e2,tp) end end function s.damval(e,re,val,r,rp,rc) local tp=e:GetHandlerPlayer() if Duel.GetFlagEffect(tp,id)==0 or r&REASON_EFFECT==0 then return val end Duel.ResetFlagEffect(tp,id) return val*2 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with a "Libromancer" card. If this card is Ritual Summoned by using a monster(s) on the field, it cannot be destroyed, or banished, by card effects. Each time a card or effect your opponent activated resolves while this card's ATK is less than 3000, this card gains 200 ATK/DEF. * The above text is unofficial and describes the card's functionality in the OCG.
--リブロマンサー・ファイアスターター --Libromancer Firestarter --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Check materials use for its Ritual Summon local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_MATERIAL_CHECK) e0:SetValue(s.matcheck) c:RegisterEffect(e0) --Cannot be destroyed by card effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.matcon) e1:SetValue(1) c:RegisterEffect(e1) --Cannot be banished by card effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_REMOVE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(1,1) e2:SetTarget(function(e,c,tp,r) return c==e:GetHandler() and r==REASON_EFFECT end) e2:SetCondition(s.matcon) c:RegisterEffect(e2) --Register a flag when an effect resolves local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetOperation(s.chainop) c:RegisterEffect(e3) --Gains 200 ATK/DEF each time an effect activated by the opponent resolves local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_CHAIN_SOLVED) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.atkcon) e4:SetOperation(s.atkop) c:RegisterEffect(e4) end s.listed_series={SET_LIBROMANCER} function s.matcheck(e,c) if c:GetMaterial():IsExists(Card.IsLocation,1,nil,LOCATION_MZONE) then local reset=RESET_EVENT|RESETS_STANDARD&~RESET_TOFIELD c:RegisterFlagEffect(id,reset,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) end end function s.matcon(e) local c=e:GetHandler() return c:IsRitualSummoned() and c:HasFlagEffect(id) end function s.chainop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id+1,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN|RESET_TURN_SET,0,1) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return ep==1-tp and c:GetAttack()<3000 and c:HasFlagEffect(id+1) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local c=e:GetHandler() --Gain 200 ATK/DEF local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetValue(200) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ Effect Monsters, including a Link Monster Gains ATK equal to the combined original ATK of all monsters this card points to. Monsters this card points to cannot attack. Once per turn (Quick Effect): You can Tribute 1 "Crusadia" or "World Legacy" monster this card points to, then target 1 face-up card your opponent controls; negate its effects until the end of this turn.
--アークロード・パラディオン --Crusadia Equimax --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2,3,s.lcheck) --Increase ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) --Cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.atklimit) c:RegisterEffect(e2) --Negate effect local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DISABLE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetRange(LOCATION_MZONE) e3:SetCost(s.discost) e3:SetTarget(s.distg) e3:SetOperation(s.disop) c:RegisterEffect(e3) end s.listed_series={SET_WORLD_LEGACY,SET_CRUSADIA} function s.lcheck(g,lc,sumtype,tp) return g:IsExists(Card.IsType,1,nil,TYPE_LINK,lc,sumtype,tp) end function s.atkval(e,c) local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil) return g:GetSum(Card.GetBaseAttack) end function s.atklimit(e,c) return e:GetHandler():GetLinkedGroup():IsContains(c) end function s.disfilter(c,e) return c:IsNegatable() and c:IsCanBeEffectTarget(e) end function s.cfilter(c,tg,lg) return c:IsSetCard({SET_WORLD_LEGACY,SET_CRUSADIA}) and lg:IsContains(c) end function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) local tg=Duel.GetMatchingGroup(s.disfilter,tp,0,LOCATION_ONFIELD,nil,e) local lg=e:GetHandler():GetLinkedGroup() if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,aux.ReleaseCheckTarget,nil,tg,lg) end local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,aux.ReleaseCheckTarget,nil,tg,lg) Duel.Release(g,REASON_COST) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsNegatable() end if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) if tc:IsType(TYPE_TRAPMONSTER) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e3) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card's name becomes "Fallen of Albaz" while on the field or in the GY. If this card is Normal or Special Summoned: You can discard 1 card, then target 1 Dragon monster your opponent controls or in their GY, and activate the appropriate effect; ● Send this card to the GY, and if you do, take control of that monster on the field until the End Phase. ● Send this card to the GY, and if you do, Special Summon that monster from the GY to your field. You can only use this effect of "The Bystial Aluber" once per turn.
--深淵の獣アルベル --The Bystial Aluber --scripted by Naim local s,id=GetID() function s.initial_effect(c) --This card's name becomes "Fallen of Albaz" on the field or in the GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_MZONE|LOCATION_GRAVE) e1:SetValue(CARD_ALBAZ) c:RegisterEffect(e1) --Take control of or Special Summon 1 Dragon monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetCost(s.cost) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_names={CARD_ALBAZ} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.tgfilter(c,e,tp,sc) if not (c:IsRace(RACE_DRAGON) and c:IsFaceup()) then return false end if c:IsLocation(LOCATION_MZONE) then return s.ctrlfilter(c,tp,sc) else return s.spfilter(c,e,tp,sc) end end function s.ctrlfilter(c,tp,sc) return Duel.GetMZoneCount(tp,sc,tp,LOCATION_REASON_CONTROL)>0 and c:IsAbleToChangeControler() end function s.spfilter(c,e,tp,sc) return Duel.GetMZoneCount(tp,sc)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() local label=e:GetLabel() if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and ((label==1 and s.ctrlfilter(chkc,tp,c)) or (label==2 and s.spfilter(chkc,e,tp,c))) end if chk==0 then return c:IsAbleToGrave() and Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil,e,tp,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil,e,tp,c):GetFirst() if tc:IsLocation(LOCATION_MZONE) then e:SetLabel(1) e:SetCategory(CATEGORY_TOGRAVE|CATEGORY_CONTROL) Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0) else e:SetLabel(2) e:SetCategory(CATEGORY_TOGRAVE|CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,tp,0) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,tp,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)>0 and c:IsLocation(LOCATION_GRAVE) then local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end local label=e:GetLabel() if label==1 then Duel.GetControl(tc,tp,PHASE_END,1) elseif label==2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the Graveyard: Draw 1 card, then place 1 card from your hand on the top of the Deck.
--フラボット --Flowerbot local s,id=GetID() function s.initial_effect(c) --Draw 1 card and return 1 card to the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) 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(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) 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.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,1,nil) if #g>0 then Duel.BreakEffect() Duel.SendtoDeck(g,nil,SEQ_DECKTOP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Once per turn: You can target 1 Fusion Monster you control; it gains 1000 ATK for each monster your opponent controls, until the end of this turn. ---------------------------------------- [ Monster Effect ] 1 "Starving Venom" monster + 1 "Odd-Eyes" monster Must be Fusion Summoned, and can then be Pendulum Summoned. Once per turn: You can target 1 face-up monster your opponent controls; until the End Phase, this card gains ATK equal to its ATK, also, this card's name becomes that monster's original name, and replace this effect with that monster's original effects. If this card in the Monster Zone is destroyed: You can Special Summon 1 monster from your Pendulum Zone, and if you do, place this card in your Pendulum Zone. * The above text is unofficial and describes the card's functionality in the OCG.
--覇王紫竜オッドアイズ・ヴェノム・ドラゴン --Odd-Eyes Venom Dragon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Pendulum.AddProcedure(c,false) Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_STARVING_VENOM),aux.FilterBoolFunctionEx(Card.IsSetCard,SET_ODD_EYES)) --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(s.splimit) c:RegisterEffect(e1) --atk up local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) --copy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCost(s.copycost) e3:SetTarget(s.copytg) e3:SetOperation(s.copyop) c:RegisterEffect(e3) --pendulum local e6=Effect.CreateEffect(c) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetDescription(aux.Stringid(id,3)) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetCode(EVENT_DESTROYED) e6:SetProperty(EFFECT_FLAG_DELAY) e6:SetCondition(s.pencon) e6:SetTarget(s.pentg) e6:SetOperation(s.penop) c:RegisterEffect(e6) end s.listed_series={SET_STARVING_VENOM,SET_ODD_EYES} s.material_setcode={SET_STARVING_VENOM,SET_VENOM,SET_ODD_EYES} function s.splimit(e,se,sp,st) return (st&SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION or (st&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function s.atkfilter(c) return c:IsFaceup() and c:IsType(TYPE_FUSION) 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) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and ct>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000*ct) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 end e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end function s.copyfilter(c) return c:IsFaceup() and not c:IsType(TYPE_TOKEN) end function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.copyfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.copyfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.copyfilter,tp,0,LOCATION_MZONE,1,1,nil) end function s.copyop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsType(TYPE_TOKEN) then local code=tc:GetOriginalCodeRule() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetValue(code) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) if not tc:IsType(TYPE_TRAPMONSTER) then c:CopyEffect(code,RESETS_STANDARD_PHASE_END,1) end local atk=tc:GetAttack() local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(atk) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) end end function s.pencon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function s.penfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.penfilter,tp,LOCATION_PZONE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_PZONE) end function s.penop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.penfilter,tp,LOCATION_PZONE,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
After a Chain with 3 or more Links resolves, destroy 1 card on your opponent's side of the field. This effect cannot activate if multiple cards/effects with the same name were activated in that Chain.
--ライトニングパニッシャー --Lightning Punisher local s,id=GetID() function s.initial_effect(c) --chain local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetOperation(s.chop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_CHAIN_END) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) e2:SetLabelObject(e1) c:RegisterEffect(e2) end function s.chop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetCurrentChain() if ct==1 then e:SetLabel(0) elseif not Duel.CheckChainUniqueness() then e:SetLabel(2) elseif ct>=3 and e:GetLabel()~=2 then e:SetLabel(1) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local res=e:GetLabelObject():GetLabel() e:GetLabelObject():SetLabel(0) return res==1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You take any battle damage your opponent would have taken from battles involving this card, instead. If this card battles, is not destroyed, and you took damage from that battle: Return this card to the hand.
--ボイコットン --Boycotton --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --damage local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(0,1) e1:SetCondition(s.dmgcond) c:RegisterEffect(e1) --to hand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLED) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end function s.dmgcond(e) return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.GetBattleDamage(e:GetHandlerPlayer())>0 end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can target 1 face-down Defense Position monster your opponent controls; take control of that target until the End Phase.
--A・O・J エネミー・キャッチャー --Ally of Justice Enemy Catcher local s,id=GetID() function s.initial_effect(c) --control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsFacedown() and c:IsDefensePos() and c:IsControlerCanBeChanged() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFacedown() and tc:IsDefensePos() then Duel.GetControl(tc,tp,PHASE_END,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Fleur Synchron" + 1+ non-Tuner monsters Once per turn, during your turn, when your opponent activates a Spell/Trap Card (Quick Effect): You can negate the activation, and if you do, destroy that card.
--フルール・ド・シュヴァリエ --Chevalier de Fleur local s,id=GetID() function s.initial_effect(c) --Synchro Summon Synchro.AddProcedure(c,s.tfilter,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --Negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.discon) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.material={19642774} s.listed_names={19642774} s.material_setcode=SET_SYNCHRON function s.tfilter(c,scard,sumtype,tp) return c:IsSummonCode(scard,sumtype,tp,19642774) or c:IsHasEffect(20932152) end function s.discon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and Duel.IsTurnPlayer(tp) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During each of your End Phases, destroy this card unless you send 1 "Iron Core of Koa'ki Meiru" from your hand to the GY or reveal 1 Rock monster in your hand. When a monster effect is activated (Quick Effect): You can Tribute this card; negate the activation, and if you do, destroy that monster.
--コアキメイル・ガーディアン --Koa'ki Meiru Guardian local s,id=GetID() function s.initial_effect(c) --cost local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.mtcon) e1:SetOperation(s.mtop) c:RegisterEffect(e1) --Negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,3)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.condition) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end s.listed_names={36623431} function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.cfilter1(c) return c:IsCode(36623431) and c:IsAbleToGraveAsCost() end function s.cfilter2(c) return c:IsMonster() and c:IsRace(RACE_ROCK) and not c:IsPublic() end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.HintSelection(Group.FromCards(c)) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil) local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_HAND,0,nil) local select=2 Duel.Hint(HINT_SELECTMSG,tp,0) if #g1>0 and #g2>0 then select=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2)) elseif #g1>0 then select=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,2)) if select==1 then select=2 end elseif #g2>0 then select=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))+1 else select=Duel.SelectOption(tp,aux.Stringid(id,2)) select=2 end if select==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=g1:Select(tp,1,1,nil) Duel.SendtoGrave(g,REASON_COST) elseif select==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=g2:Select(tp,1,1,nil) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) else Duel.Destroy(c,REASON_COST) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsMonsterEffect() and Duel.IsChainNegatable(ev) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
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. When this card is destroyed by battle, add 1 "Thousand-Eyes Jellyfish" or 1 "Cranium Fish" from your Deck to your hand.
--オーシャンズ・オーパー --Ocean's Keeper local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_PIERCE) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.filter(c) return c:IsCode(81434470,18828179) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can declare 1 Monster Type; monsters in the GYs become that Type for the rest of this turn (even if this card leaves the field).
--輪廻独断 --Rebirth Judgment --Scripted by Eerie Code 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) --Change race local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetTarget(s.tg) e2:SetOperation(s.op) c:RegisterEffect(e2) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local rc=Duel.AnnounceRace(tp,1,RACE_ALL) e:SetLabel(rc) --Operation info needed to handle the interaction with "Necrovalley" Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0) end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local race=e:GetLabel() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetTargetRange(LOCATION_GRAVE,LOCATION_GRAVE) e1:SetTarget(s.rctg) e1:SetValue(race) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --id chk local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(4064256) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,1) e2:SetValue(s.val(race)) c:RegisterEffect(e2) end function s.rctg(e,c) if c:GetFlagEffect(1)==0 then c:RegisterFlagEffect(1,0,0,0) local eff if c:IsLocation(LOCATION_MZONE) then eff={Duel.GetPlayerEffect(c:GetControler(),EFFECT_NECRO_VALLEY)} else eff={c:GetCardEffect(EFFECT_NECRO_VALLEY)} end c:ResetFlagEffect(1) for _,te in ipairs(eff) do local op=te:GetOperation() if not op or op(e,c) then return false end end end return true end function s.val(race) return function(e,c,re,chk) if chk==0 then return true end return race end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 monster you control; destroy it, and if you do, add 1 "Peaceful Planet Calarium" from your Deck to your hand, or, if you control "Peaceful Planet Calarium", you can add 1 "Mannadium" Spell/Trap instead, except "Mannadium Abscission". You can banish this card from your GY; Special Summon 1 "Visas Starfrost" or 1 monster with 1500 ATK/2100 DEF from your hand. You can only use each effect of "Mannadium Abscission" once per turn.
--伍世壊摘心 --Mannadium Abscission --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Destroy 1 monster and search 1 "Peaceful Planet Calarium" or 1 "Mannadium" Spell/Trap local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Special Summon 1 "Visas Starfrost" or 1 monster with 1500 ATK/2100 DEF from hand 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(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={id,CARD_VISAS_STARFROST,82460246} --Peaceful Planet Calarium s.listed_series={SET_MANNADIUM} function s.thfilter(c,alt) return c:IsAbleToHand() and (c:IsCode(82460246) or (alt and c:IsSetCard(SET_MANNADIUM) and c:IsSpellTrap() and not c:IsCode(id))) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end local alt=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,82460246),tp,LOCATION_ONFIELD,0,1,nil) if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,alt) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then local alt=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,82460246),tp,LOCATION_ONFIELD,0,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,alt) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end function s.spfilter(c,e,tp) return (c:IsCode(CARD_VISAS_STARFROST) or (c:IsAttack(1500) and c:IsDefense(2100))) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: Send 1 monster you control to the GY, or if "Golden Castle of Stromberg" is in a Field Zone, you can send 1 monster your opponent controls to the GY, instead. Once per turn, during your Standby Phase: You can target the monster that was sent to the GY by this card's effect; destroy this card, and if you do, Special Summon that monster to your field. You can only activate 1 "Iron Cage" per turn.
--鉄の檻 --Iron Cage -- local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetCountLimit(1) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) e2:SetLabelObject(e1) c:RegisterEffect(e2) end s.listed_names={CARD_STROMBERG} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local loc=0 if Duel.IsEnvironment(CARD_STROMBERG) then loc=LOCATION_MZONE end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,loc,1,nil) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local loc=0 if Duel.IsEnvironment(CARD_STROMBERG) then loc=LOCATION_MZONE end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,loc,1,1,nil):GetFirst() if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) e:SetLabelObject(tc) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.filter(c,e,tp) return c==e:GetLabelObject():GetLabelObject() and c:GetFlagEffect(id)>0 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) 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) 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) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the GY while equipped to a monster: You can draw 1 card. You can only use each of the following effects of "Cyberdark Cannon" once per turn. ● You can discard this card; add 1 Machine "Cyberdark" monster from your Deck to your hand. ● During damage calculation, if a monster equipped with this card battles: You can send 1 monster from your Deck to the GY.
--サイバー・ダーク・カノン --Cyberdark Cannon local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --send to grave local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.gycon) e2:SetTarget(s.gytg) e2:SetOperation(s.gyop) c:RegisterEffect(e2) --draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.con) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end s.listed_series={SET_CYBERDARK} function s.filter(c) return c:IsSetCard(SET_CYBERDARK) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #tg>0 then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end function s.tgfilter(c) return c:IsMonster() and c:IsAbleToGrave() end function s.gycon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and (ec==Duel.GetAttacker() or ec==Duel.GetAttackTarget()) end function s.gytg(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.gyop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function s.con(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:GetPreviousLocation()==LOCATION_SZONE and not c:IsReason(REASON_LOST_TARGET) end function s.tg(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.op(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:
You can target 1 "Utopia" monster you control; equip this monster from your hand or your side of the field to that target. It gains 1200 ATK. While this card is equipped to a monster, face-up "ZW -" cards you control cannot be destroyed by your opponent's card effects. If a monster equipped with this card would be destroyed by a card effect, destroy this card instead. You can only control 1 face-up "ZW - Lightning Blade".
--ZW-雷神猛虎剣 --ZW - Lightning Blade 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) --"ZW" cards cannot be destroyed by your opponent's effects while this card is equipped to a monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_ONFIELD,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_ZW)) e2:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end) e2:SetValue(aux.indoval) c:RegisterEffect(e2) --Destruction replacement for the equipped monster 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,SET_ZW} 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(1200) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) end function s.repval(e,re,r,rp) return (r&REASON_EFFECT)~=0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Once per turn: You can target 1 face-up monster on the field; increase its Level by 1 (even if this card leaves the field). ---------------------------------------- [ Flavor Text ] A kindly elder brother, Risebell takes good care of his little sister Saambell. He reads a Magical Book with his sister each early-afternoon, a harmonious routine that brings a smile to everyone.
--召喚師ライズベルト --Risebell the Summoner local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --level local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetTarget(s.lvtg) e2:SetOperation(s.lvop) c:RegisterEffect(e2) end function s.filter(c) return c:IsFaceup() and c:HasLevel() end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.lvop(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) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1+ Effect Monsters You can only control 1 "Worldsea Dragon Zealantis". You can only use each of the following effects of "Worldsea Dragon Zealantis" once per turn. During your Main Phase: You can banish all monsters on the field, then Special Summon as many monsters as possible that were banished by this effect, to their owners' fields, face-up, or in face-down Defense Position. During the Battle Phase (Quick Effect): You can destroy cards on the field up to the number of co-linked monsters on the field.
--世海龍ジーランティス --Worldsea Dragon Zealantis --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 1+ Effect Monsters Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),1) --You can only control 1 "Worldsea Dragon Zealantis" c:SetUniqueOnField(1,0,id) --Banish all monsters on the field, then Special Summon as many monsters as possible that were banished by this effect, to their owners' fields, face-up, or in face-down Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.rmsptg) e1:SetOperation(s.rmspop) c:RegisterEffect(e1) --Destroy cards on the field up to the number of co-linked monsters on the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function() return Duel.IsBattlePhase() end) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.rmsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_EITHER,LOCATION_REMOVED) end function s.spfilter(c,e,tp) local owner=c:GetOwner() return c:IsFaceup() and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,owner) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,owner)) end function s.rmspop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then local og=Duel.GetOperatedGroup() local sg=og:Filter(s.spfilter,nil,e,tp) if #sg==0 then return end local your_sg,opp_sg=sg:Split(Card.IsOwner,nil,tp) local your_ft,opp_ft=Duel.GetLocationCount(tp,LOCATION_MZONE),Duel.GetLocationCount(1-tp,LOCATION_MZONE) if #your_sg>your_ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) your_sg=your_sg:Select(tp,your_ft,your_ft,nil) end if #opp_sg>opp_ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) opp_sg=opp_sg:Select(tp,opp_ft,opp_ft,nil) end sg=your_sg+opp_sg for sc in sg:Iter() do local sump=0 local owner=sc:GetOwner() if sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,owner) then sump=sump|POS_FACEUP end if sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,owner) then sump=sump|POS_FACEDOWN_DEFENSE end Duel.SpecialSummonStep(sc,0,tp,owner,false,false,sump) end local fdg=sg:Filter(Card.IsFacedown,nil) if #fdg>0 then Duel.ConfirmCards(1-tp,fdg) end Duel.BreakEffect() Duel.SpecialSummonComplete() end end function s.desctfilter(c) return c:GetMutualLinkedGroupCount()>0 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) if chk==0 then return #dg>0 and Duel.IsExistingMatchingCard(s.desctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(s.desctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if ct==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil) if #g>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase: You can Special Summon 1 "Ancient Warriors" monster from your hand, and if you do, take damage equal to its Level x 100. You can send this face-up card from the Spell & Trap Zone to the GY, then target 1 "Ancient Warriors" monster on the field; change it to any Attribute, then, if you targeted an opponent's monster, you can take control of it. You can only use each effect of "Ancient Warriors Saga - Deception and Betrayal" once per turn.
--戦華史略-矯詔之叛 --Ancient Warriors Saga - Deception and Betrayal --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Change Attribute local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_CONTROL) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.SelfToGrave) e3:SetTarget(s.attg) e3:SetOperation(s.atop) c:RegisterEffect(e3) end s.listed_series={SET_ANCIENT_WARRIORS} function s.spfilter(c,e,sp) return c:IsSetCard(SET_ANCIENT_WARRIORS) and c:IsCanBeSpecialSummoned(e,0,sp,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.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.Damage(tp,tc:GetLevel()*100,REASON_EFFECT) end end function s.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsSetCard(SET_ANCIENT_WARRIORS) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_ANCIENT_WARRIORS),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local tc=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_ANCIENT_WARRIORS),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst() if tc:IsControler(1-tp) then e:SetLabel(1) else e:SetLabel(0) end end function s.atop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then local att=tc:AnnounceAnotherAttribute(tp) --Change Attribute local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetValue(att) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) if e:GetLabel()==1 and tc:IsControlerCanBeChanged() and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.GetControl(tc,tp) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When an opponent's monster declares an attack: You can banish this card from your Graveyard, then target 1 Spell Card in your Graveyard; send the top card of your Deck to the Graveyard, and if you do, return the target to the bottom of your Deck.
--マジック・リサイクラー --Spell Recycler local s,id=GetID() function s.initial_effect(c) --todeck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TODECK) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function s.filter(c) return c:IsSpell() and c:IsAbleToDeck() 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.IsPlayerCanDiscardDeck(tp,1) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if Duel.DiscardDeck(tp,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate only when a monster(s) is Special Summoned from your Graveyard. Select and Special Summon 1 "Supay" or 1 "Fire Ant Ascator" from your Graveyard.
--死神の呼び声 --Call of the Reaper 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_SPSUMMON_SUCCESS) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfiltetr(c,tp) return c:IsPreviousLocation(LOCATION_GRAVE) and c:IsPreviousControler(tp) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfiltetr,1,nil,tp) end function s.filter(c,e,tp) return c:IsCode(78552773,78275321) 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:
At the start of your Main Phase 1: Neither player can Normal or Special Summon Effect Monsters, until your next Draw Phase.
--大熱波 --Heat Wave local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPhase(PHASE_MAIN1) and not Duel.CheckPhaseActivity() end function s.operation(e,tp,eg,ep,ev,re,r,rp) --Cannot Normal or Special Summon Effect Monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,1) e1:SetTarget(s.sumlimit) e1:SetReset(RESET_PHASE|PHASE_END,2) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) end function s.sumlimit(e,c,sump,sumtype,sumpos,targetp) if c:IsMonster() then return c:IsType(TYPE_EFFECT) else return c:IsOriginalType(TYPE_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Target 1 monster your opponent controls; destroy that target.
--執念深き老魔術師 --Old Vindictive Magician local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_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,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by banishing 5 "Metaphys" cards with different names from your GY and/or face-up from your field. Cannot be destroyed, or banished, by card effects. Once per turn, if your opponent controls more cards than you do: You can target 1 of your banished "Metaphys" monsters; Special Summon it, but banish it during the End Phase of the next turn.
--メタファイズ・エグゼキューター --Metaphys Executor local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --spsummon limit local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) 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.sprcon) e2:SetTarget(s.sprtg) e2:SetOperation(s.sprop) c:RegisterEffect(e2) --indes local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetValue(1) c:RegisterEffect(e3) --cannot be banished local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(EFFECT_CANNOT_REMOVE) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(1,1) e4:SetTarget(s.rmlimit) c:RegisterEffect(e4) --spsummon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,0)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCountLimit(1) e5:SetRange(LOCATION_MZONE) e5:SetCondition(s.spcon) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) end s.listed_series={SET_METAPHYS} function s.rmlimit(e,c,tp,r) return c==e:GetHandler() and r==REASON_EFFECT end function s.sprfilter(c) return c:IsSetCard(SET_METAPHYS) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsLocation(LOCATION_SZONE) or aux.SpElimFilter(c,true,true)) end function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg end function s.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,nil) return aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,0) end function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c) local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,c) local rg=aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,1,tp,HINTMSG_REMOVE,nil,nil,true) if #rg>0 then rg:KeepAlive() e:SetLabelObject(rg) return true end return false end function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) local rg=e:GetLabelObject() if not rg then return end Duel.Remove(rg,POS_FACEUP,REASON_COST) rg:DeleteGroup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) end function s.spfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_METAPHYS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetLabel(Duel.GetTurnCount()+1) e2:SetLabelObject(tc) e2:SetReset(RESET_PHASE|PHASE_END,2) e2:SetCondition(s.rmcon) e2:SetOperation(s.rmop) Duel.RegisterEffect(e2,tp) end end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:GetFlagEffect(id)~=0 then return Duel.GetTurnCount()==e:GetLabel() 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 a Zombie monster(s) you control would be destroyed by battle or card effect, you can banish this card from your hand or GY instead. If this card is banished from the hand or GY: You can Special Summon this card in Defense Position, then you can reduce its Level by 1. You can only use each effect of "Alghoul Mazera" once per turn.
--アルグールマゼラ --Alghoul Mazera --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Substitute destruction for your Zombie monster(s) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetTarget(s.reptg) e1:SetValue(s.repval) e1:SetOperation(s.repop) c:RegisterEffect(e1) --Special Summon itself it is banished from the hand or GY 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:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_REMOVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end --If your Zombie monster(s) would be destroyed by battle or effect function s.repfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_ZOMBIE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end --Activation legality function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,c,96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE) end --Check if it was in hand/GY function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND|LOCATION_GRAVE) end --Activation legality 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,0,0) end --Special Summon itself function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() --Decrease Level by 1 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) e1:SetValue(-1) c:RegisterEffect(e1) 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.
--モアイ迎撃砲 --Moai Interceptor Cannons 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) end 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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 "HERO" monsters Once per turn: You can target 1 face-up monster your opponent controls and 1 other "HERO" monster you control; the opponent's targeted monster loses ATK and DEF equal to the ATK of your targeted monster, until the end of this turn.
--V・HERO アドレイション --Vision HERO Adoration local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_HERO),2) --summon success local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.valtg) e2:SetOperation(s.valop) c:RegisterEffect(e2) end s.listed_series={SET_HERO} s.material_setcode=SET_HERO function s.sfilter(c) return c:IsFaceup() and c:IsSetCard(SET_HERO) end function s.valtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) local g1=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) end function s.valop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local o=e:GetLabelObject() local s=g:GetFirst() if s==o then s=g:GetNext() end if s:IsFaceup() and o:IsFaceup() and s:IsRelateToEffect(e) and o:IsRelateToEffect(e) then local val=s:GetAttack()*-1 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(val) o:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) o:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When you activate this card, you can also Tribute 1 Reptile monster in your hand or field; apply 1 of these effects, or if you Tributed a monster at activation, you can apply both effects in sequence. ● Add 1 "Mitsurugi" monster from your Deck to your hand. ● Take 800 damage, then you can Special Summon 1 "Mitsurugi" monster from your hand or GY, but it cannot attack directly. You can only activate 1 "Mitsurugi Prayers" per turn.
--巳剣勧請 --Mitsurugi Prayers --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Apply 1 of these effects, or if you Tributed a monster at activation, you can apply both effects in sequence local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.effcost) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) end s.listed_series={SET_MITSURUGI} function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,true,nil,nil,RACE_REPTILE) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then local g=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,true,nil,nil,RACE_REPTILE) Duel.Release(g,REASON_COST) e:SetLabel(1) else e:SetLabel(0) end end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,1,tp,800) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) end function s.thfilter(c) return c:IsSetCard(SET_MITSURUGI) and c:IsMonster() and c:IsAbleToHand() end function s.spfilter(c,e,tp) return c:IsSetCard(SET_MITSURUGI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.effop(e,tp,eg,ep,ev,re,r,rp) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local both=b1 and e:GetLabel()==1 local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,2)}, {true,aux.Stringid(id,3)}, {both,aux.Stringid(id,4)}) local breakeffect=false if op==1 or op==3 then --Add 1 "Mitsurugi" monster from your Deck to your hand 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) Duel.ShuffleHand(tp) breakeffect=true end end if op==2 or op==3 then --Take 800 damage if breakeffect then Duel.BreakEffect() end Duel.Damage(tp,800,REASON_EFFECT) --Special Summon 1 "Mitsurugi" monster from your hand or GY, but it cannot attack directly if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() Duel.BreakEffect() if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then --It cannot attack directly local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3207) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 2 other face-up Spell/Trap Cards and 3 Set Spell/Trap Cards, on the field; destroy them.
--フルハウス --Full House local s,id=GetID() function s.initial_effect(c) --Destroy 2 other face-up Spells/Traps and 3 Set Spells/Traps on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.desfilter(c,e) return c:IsSpellTrap() and c:IsCanBeEffectTarget(e) end function s.rescon(sg,e,tp,mg) return sg:IsExists(Card.IsFaceup,2,nil) and sg:IsExists(Card.IsFacedown,3,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,0) end local tg=aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,1,tp,HINTMSG_DESTROY) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,5,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg>0 then Duel.Destroy(tg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is detached from an Xyz Monster and sent to the Graveyard to activate that monster's effect: You can banish this card from your Graveyard, then target 1 "Raidraptor" card in your Graveyard; add it to your hand. You can only use this effect of "Raidraptor - Skull Eagle" once per turn. An Xyz Monster that was Summoned using this card on the field as Xyz Material gains this effect. ● If it is Xyz Summoned: It gains 300 ATK.
--RR-スカル・イーグル --Raidraptor - Skull Eagle local s,id=GetID() function s.initial_effect(c) --Add from GY to hand when detached local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetDescription(aux.Stringid(id,0)) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Grant effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(s.efcon) e2:SetOperation(s.efop) c:RegisterEffect(e2) end s.listed_series={SET_RAIDRAPTOR} function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) and c:IsPreviousLocation(LOCATION_OVERLAY) end function s.thfilter(c) return c:IsSetCard(SET_RAIDRAPTOR) 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,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.efcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_XYZ end function s.efop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() local e1=Effect.CreateEffect(rc) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.atkcon) e1:SetOperation(s.atkop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1,true) if not rc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e2,true) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(300) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can Special Summon 1 Level 4 or lower "HERO" monster from your hand. If this card is sent from the Monster Zone to the GY by a Spell effect: You can target 1 "HERO" monster in your GY, except "Elemental HERO Solid Soldier"; Special Summon it in Defense Position. You can only use this effect of "Elemental HERO Solid Soldier" once per turn.
--E・HERO ソリッドマン --Elemental HERO Solid Soldier local s,id=GetID() function s.initial_effect(c) --Special summon a monster from the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --Special summon a monster from the gravayeard 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_TO_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end s.listed_series={SET_HERO} s.listed_names={id} function s.spfilter1(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(SET_HERO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop1(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_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return re and re:GetHandler():IsSpell() and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) end function s.spfilter2(c,e,tp) return c:IsSetCard(SET_HERO) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter2(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is in your hand: You can Fusion Summon 1 "D/D/D" Fusion Monster from your Extra Deck, using monsters from your hand as Fusion Materials, including this card. You can banish this card from your GY; Special Summon 1 "D/D" monster from your hand. You can only use each effect of "D/D Swirl Slime" once per turn.
--DDスワラル・スライム --D/D Swirl Slime local s,id=GetID() function s.initial_effect(c) --spsummon local params = {aux.FilterBoolFunction(Card.IsSetCard,SET_DDD),Fusion.InHandMat,nil,nil,Fusion.ForcedHandler} local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetTarget(Fusion.SummonEffTG(table.unpack(params))) e1:SetOperation(Fusion.SummonEffOP(table.unpack(params))) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_DD,SET_DDD} function s.spfilter(c,e,tp) return c:IsSetCard(SET_DD) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] You can target 1 "Fluffal" or "Edge Imp" monster in your GY; Special Summon it, also, you cannot Special Summon monsters from the Extra Deck for the rest of this turn, except Fusion Monsters (even if this card leaves the field). You can only use this effect of "Fluffal Angel" once per turn. ---------------------------------------- [ Monster Effect ] You can Tribute this card, then target 1 "Frightfur" Fusion Monster in your GY; discard 1 card, and if you do, Special Summon the targeted monster. You can only use this effect of "Fluffal Angel" once per turn.
--ファーニマル・エンジェル --Fluffal Angel --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --Pendulum summon Pendulum.AddProcedure(c) --Special summon from the graveyard local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special summon 1 "Frightfur" Fusion Monster 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end s.listed_series={SET_FLUFFAL,SET_EDGE_IMP,SET_FRIGHTFUR} function s.filter(c,e,tp) return (c:IsSetCard(SET_FLUFFAL) or c:IsSetCard(SET_EDGE_IMP)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --lizard check aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) end function s.splimit(e,c) return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) end function s.lizfilter(e,c) return not c:IsOriginalType(TYPE_FUSION) end function s.filter2(c,e,tp) return c:IsSetCard(SET_FRIGHTFUR) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter2(chkc,e,tp) end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD)==0 then return end local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner LIGHT monsters If this card is in face-up Defense Position during your End Phase, you can add 1 Equip Spell Card from your Deck to your hand.
--ヴァイロン・デルタ --Vylon Delta local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsAttribute,ATTRIBUTE_LIGHT),1,99) c:EnableReviveLimit() --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and e:GetHandler():IsDefensePos() end function s.filter(c) return c:IsType(TYPE_EQUIP) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFacedown() or c:IsAttackPos() or not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish up to 3 Spells/Traps from your GY face-down; Special Summon 1 Normal Monster from your Deck, whose Level equals the number of cards banished to activate this effect.
--トレジャー・パンダー --Treasure Panda local s,id=GetID() function s.initial_effect(c) --Special Summon 1 Normal Monster from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsSpellTrap() and c:IsAbleToRemoveAsCost(POS_FACEDOWN) end function s.rescon(sg,e,tp,mg) return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,#sg,false) end function s.spfilter(c,e,tp,lvl,chk) if not (c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end return (chk and c:IsLevelBelow(lvl)) or c:IsLevel(lvl) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil) local ct=math.min(#g,3) if chk==0 then return ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ct,true) end local rg=aux.SelectUnselectGroup(g,e,tp,1,ct,s.rescon,1,tp,HINTMSG_REMOVE,s.rescon) Duel.Remove(rg,POS_FACEDOWN,REASON_COST) e:SetLabel(#rg) 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 local lvl=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lvl,false) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with any "Gishki" Ritual Spell Card. When this card is Ritual Summoned: Look at up to 2 random cards in your opponent's hand, then shuffle 1 of them into the Deck.
--イビリチュア・ガストクラーケ --Evigishki Gustkraken local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Reveal and shuffle cards into the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GISHKI} function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsRitualSummoned() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_HAND) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if #g==0 then return end local ct=1 if #g>1 then ct=Duel.AnnounceNumber(tp,1,2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) g=g:RandomSelect(tp,ct) Duel.ConfirmCards(tp,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local sg=g:Select(tp,1,1,nil) Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.ShuffleHand(1-tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Flame Manipulator" + "Masaki the Legendary Swordsman"
--炎の剣士 --Flame Swordsman local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,34460851,44287299) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If "Advanced Dark" is not in a Field Zone, send this monster to the GY. You can send this card from your hand or field to the GY; add 1 "Advanced Dark" from your Deck to your hand. Once per turn: You can target 1 "Advanced Crystal Beast" card you control; return it to the hand or place it on top of the Deck. If this face-up card is destroyed in a Monster Zone, you can place it face-up in your Spell & Trap Zone as a Continuous Spell, instead of sending it to the GY.
--A宝玉獣コバルト・イーグル --Advanced Crystal Beast Cobalt Eagle --scripted by Naim local s,id=GetID() function s.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE) --Send itself to the GY if "Adanced Dark" is not face-up in the Field Spell Zone local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_SELF_TOGRAVE) e1:SetCondition(s.tgcon) c:RegisterEffect(e1) --Place itself in the S/T instead of sending it to the GY local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetCondition(s.replacecon) e2:SetOperation(s.replaceop) c:RegisterEffect(e2) --Add 1 "Advanced Dark" to the hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND|LOCATION_MZONE) e3:SetCost(Cost.SelfToGrave) e3:SetTarget(s.searchtg) e3:SetOperation(s.searchop) c:RegisterEffect(e3) --Target 1 "Advanced Crystal Beast" card and add it to hand or to the deck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetTarget(s.thdtg) e4:SetOperation(s.thdop) c:RegisterEffect(e4) end s.listed_names={CARD_ADVANCED_DARK} s.listed_series={SET_ADVANCED_CRYSTAL_BEAST} function s.tgcon(e) return not Duel.IsEnvironment(CARD_ADVANCED_DARK) end function s.replacecon(e) local c=e:GetHandler() return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) end function s.replaceop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TURN_SET) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) c:RegisterEffect(e1) Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) end function s.sfilter(c) return c:IsCode(CARD_ADVANCED_DARK) and c:IsAbleToHand() end function s.searchtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.searchop(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.sfilter,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.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_ADVANCED_CRYSTAL_BEAST) and (c:IsAbleToHand() or c:IsAbleToDeck()) end function s.thdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.cfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_ONFIELD) Duel.SetPossibleOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_ONFIELD) end function s.thdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then aux.ToHandOrElse(tc,tp, function(c) return c:IsAbleToDeck() end, function(tc) Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT) end, aux.Stringid(id,2) ) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate this card by banishing 1 Plant monster from your GY, then target 1 face-up monster your opponent controls; equip this card to it. Take control of the equipped monster. Once per turn, during your End Phase: Negate this card's effect until your next Standby Phase.
--薔薇の刻印 --Mark of the Rose local s,id=GetID() function s.initial_effect(c) --Activate this card by banishing 1 Plant monster from your GY, then target 1 face-up monster your opponent controls; equip this card to it aux.AddEquipProcedure(c,1,aux.CheckStealEquip,s.eqlimit,s.cost,s.target) --Take control of the equipped monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_SET_CONTROL) e1:SetValue(function(e,c) return e:GetHandler():GetFlagEffectLabel(id) end) c:RegisterEffect(e1) --Negate this card's effect until your next Standby Phase local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:SetFlagEffectLabel(id,1-tp) c:RegisterFlagEffect(id+1,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY,EFFECT_FLAG_CLIENT_HINT,2,0,aux.Stringid(id,1)) --Choose when to reset the negation during your next Standby Phase local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1) e1:SetCondition(function() return Duel.IsTurnPlayer(tp) end) e1:SetOperation(function() Duel.Hint(HINT_CARD,0,id) c:SetFlagEffectLabel(id,tp) e1:Reset() end) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY,2) c:RegisterEffect(e1) end) c:RegisterEffect(e2) end function s.eqlimit(e,c) return c:IsControler(1-e:GetHandlerPlayer()) or e:GetHandler():GetEquipTarget()==c end function s.costfilter(c) return c:IsRace(RACE_PLANT) and c:IsAbleToRemove() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,tc) e:SetCategory(CATEGORY_CONTROL+CATEGORY_EQUIP) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,tp) Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,tp,0) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase: You can Special Summon 1 monster from your hand with the same Level as this card. This effect can only be used once while this card is face-up on the field.
--召喚師セームベル --Saambell the Summoner local s,id=GetID() function s.initial_effect(c) --Special Summon a monster with the same Level as this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e1:SetCountLimit(1) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spfilter(c,e,tp,lv) return c:IsLevel(lv) 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,e:GetHandler():GetLevel()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsFaceup() and c:IsRelateToEffect(e)) 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,c:GetLevel()) 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 any number of "Photon" monsters in your GY; Special Summon them, but their effects are negated. During your Main Phase: You can banish this card from your GY, then target 1 "Photon" monster your opponent controls; take control of it, and if you do, its ATK for the rest of this turn becomes the combined original ATK of all "Photon" monsters you currently control, also you cannot declare attacks this turn, except with that monster. You can only use each effect of "Eternal Bond" once per turn.
--エターナル・ボンド --Eternal Bond --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon any number of "Photon" monsters from the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Take control of 1 "Photon" monster your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_CONTROL) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.IsMainPhase() end) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.cttg) e2:SetOperation(s.ctop) c:RegisterEffect(e2) end s.listed_series={SET_PHOTON} function s.filter(c,e,tp) return c:IsSetCard(SET_PHOTON) 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,nil) end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local sg=Duel.GetTargetCards(e) if #sg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if #sg>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) sg=sg:Select(tp,ft,ft,nil) end if #sg>0 then for tc in sg:Iter() do Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2,true) end end end function s.cttarget(c,e) return c:IsSetCard(SET_PHOTON) and c:IsFaceup() and c:IsControlerCanBeChanged() and (not e or c:IsCanBeEffectTarget(e)) end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.cttarget(chkc) end if chk==0 then return Duel.IsExistingTarget(s.cttarget,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.SelectTarget(tp,s.cttarget,tp,0,LOCATION_MZONE,1,1,nil) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) --cannot attack local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetLabelObject(tc) e1:SetTarget(s.atktg) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --change ATK local atk=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,SET_PHOTON):GetSum(Card.GetBaseAttack) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SET_ATTACK_FINAL) e2:SetReset(RESETS_STANDARD_PHASE_END) e2:SetValue(atk) tc:RegisterEffect(e2) end end function s.atktg(e,c) return e:GetLabelObject()~=c end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Special Summoned by the effect of a "Geargia" card: You can Special Summon 1 "Geargia" monster from your hand or Graveyard in Defense Position, except "Geargiano Mk-III", but its effects are negated. You can only use this effect of "Geargiano Mk-III" once per turn. You cannot Special Summon monsters the turn you activate this effect, except "Geargia" monsters.
--ギアギアーノ Mk-III --Geargiano Mk-III local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end s.listed_series={SET_GEARGIA} s.listed_names={id} function s.counterfilter(c) return c:IsSetCard(SET_GEARGIA) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return re:GetHandler():IsSetCard(SET_GEARGIA) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(SET_GEARGIA) end function s.filter(c,e,tp) return c:IsSetCard(SET_GEARGIA) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE|LOCATION_HAND,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner monsters Your opponent cannot target face-up Warrior-Type monsters for attacks, except this one. Once per turn, if this card would be destroyed by battle, it is not destroyed.
--スカー・ウォリアー --Scarred Warrior local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --cannot be battle target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetValue(s.atlimit) c:RegisterEffect(e1) --battle indes local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e2:SetCountLimit(1) e2:SetValue(s.valcon) c:RegisterEffect(e2) end function s.atlimit(e,c) return c~=e:GetHandler() and c:IsFaceup() and c:IsRace(RACE_WARRIOR) end function s.valcon(e,re,r,rp) return (r&REASON_BATTLE)~=0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate only while there are 3 Monster Cards with the same name in your Graveyard. Select 1 of those monsters, Special Summon it, and equip it with this card. When this card is destroyed, destroy the equipped monster.
--継承の印 --Symbol of Heritage 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.operation) c:RegisterEffect(e1) --Destroy local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.filter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,2,c,c:GetCode()) 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) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.eqlimit(e,c) return e:GetOwner()==c end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end Duel.Equip(tp,c,tc) --Add Equip limit local e1=Effect.CreateEffect(tc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) c:RegisterEffect(e1) end end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=c:GetFirstCardTarget() if c:IsReason(REASON_DESTROY) and tc and tc:IsLocation(LOCATION_MZONE) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Inflict 500 points of damage to your opponent's Life Points and increase your Life Points by 500 points.
--盗人ゴブリン --Goblin Thief local s,id=GetID() function s.initial_effect(c) --recover&damage local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DAMAGE) e1:SetCode(EVENT_FREE_CHAIN) 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_RECOVER,nil,0,tp,500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(1-tp,500,REASON_EFFECT,true) Duel.Recover(tp,500,REASON_EFFECT,true) Duel.RDComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is sent to the GY if you have any cards in your hand. If an "Infernity" monster(s) and/or a Level 8 DARK Dragon Synchro Monster(s) you control would be destroyed by your opponent's card effect, you can banish 1 "Infernity" card from your GY instead.
--煉獄の釜 --Void Cauldron --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Banish to prevent destruction local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetRange(LOCATION_SZONE) e1:SetTarget(s.reptg) e1:SetValue(s.repval) e1:SetOperation(s.repop) c:RegisterEffect(e1) --Send to GY local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_SELF_TOGRAVE) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.sdcon) c:RegisterEffect(e2) end function s.dsdlv8filter(c) return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO) end function s.dfilter(c,tp) return (s.dsdlv8filter(c) or (c:IsSetCard(SET_INFERNITY) and c:IsMonster())) and c:IsControler(tp) and c:IsReason(REASON_EFFECT) end function s.repfilter(c) return c:IsSetCard(SET_INFERNITY) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(s.dfilter,1,nil,tp) and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_GRAVE|LOCATION_MZONE,0,1,nil) end return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) end function s.repval(e,c) return c:IsControler(e:GetHandlerPlayer()) and (s.dsdlv8filter(c) or (c:IsSetCard(SET_INFERNITY) and c:IsMonster())) and c:IsReason(REASON_EFFECT) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_GRAVE|LOCATION_MZONE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end function s.sdcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When you Normal Summon a "Resonator" monster: You can Special Summon this card from your hand, but its ATK becomes halved.
--レッド・ウルフ --Red Warg 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_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_RESONATOR} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and eg:GetFirst():IsSetCard(SET_RESONATOR) 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 if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then local atk=c:GetAttack() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(atk/2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1,true) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Add 1 "Heroic" monster from your Deck to your hand. If your LP are 500 or less: You can banish this card from your GY, then target 1 "Heroic" card in your GY; add it to your hand. You can only use each effect of "Heroic Envoy" once per turn.
--ヒロイック・エンヴォイ --Heroic Envoy --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Search 1 "Heroic" monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.dthtg) e1:SetOperation(s.dthop) c:RegisterEffect(e1) --Add 1 "Heroic" card from the GY to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(_,tp) return Duel.GetLP(tp)<=500 end) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.gthtg) e2:SetOperation(s.gthop) c:RegisterEffect(e2) end s.listed_series={SET_HEROIC} function s.thfilter(c) return c:IsSetCard(SET_HEROIC) and c:IsAbleToHand() end function s.dthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(s.thfilter,Card.IsMonster),tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.dthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.AND(s.thfilter,Card.IsMonster),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.gthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,c) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE) end function s.gthop(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 Level 6 "Archfiend" Normal Monster + 1 "Red-Eyes" Normal Monster You can only Special Summon "Archfiend Black Skull Dragon(s)" once per turn. If this card battles, your opponent's cards and effects cannot be activated until the end of the Damage Step. If damage calculation is performed involving this Fusion Summoned card, at the end of the Battle Phase: You can target 1 "Red-Eyes" Normal Monster in your Graveyard; inflict damage to your opponent equal to its ATK in the Graveyard, then shuffle it into the Deck.
--悪魔竜ブラック・デーモンズ・ドラゴン --Archfiend Black Skull Dragon local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) --fusion material Fusion.AddProcMix(c,true,true,s.mfilter1,s.mfilter2) c:EnableReviveLimit() --aclimit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(0,1) e1:SetCondition(s.accon) e1:SetValue(1) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE|PHASE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetCondition(s.damcon) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) end s.listed_series={SET_RED_EYES} s.material_setcode={SET_RED_EYES,SET_ARCHFIEND} function s.mfilter1(c,fc,sumtype,tp) return c:IsSetCard(SET_ARCHFIEND,fc,sumtype,tp) and c:IsType(TYPE_NORMAL,fc,sumtype,tp) and c:GetLevel()==6 end function s.mfilter2(c,fc,sumtype,tp) return c:IsSetCard(SET_RED_EYES,fc,sumtype,tp) and c:IsType(TYPE_NORMAL,fc,sumtype,tp) end function s.accon(e) return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsFusionSummoned() and c:GetBattledGroupCount()>0 end function s.filter(c) return c:IsSetCard(SET_RED_EYES) and c:IsType(TYPE_NORMAL) and c:IsAbleToDeck() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) local atk=g:GetFirst():GetBaseAttack() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Damage(1-tp,tc:GetBaseAttack(),REASON_EFFECT)~=0 then Duel.BreakEffect() Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Take 1 "Lyrilusc" monster from your Deck, and either add it to your hand or send it to the GY, then you can Special Summon 1 "Lyrilusc" monster with a different name from your hand. You can only activate 1 "Lyrilusc - Bird Call" per turn.
--LL-バード・コール --Lyrilusc - Bird Call --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_LYRILUSC} function s.filter(c) return c:IsSetCard(SET_LYRILUSC) and c:IsMonster() and (c:IsAbleToHand() or c:IsAbleToGrave()) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end end function s.spfilter(c,e,tp,tc) return c:IsSetCard(SET_LYRILUSC) and not c:IsCode(tc:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) local tc=g:GetFirst() if not tc then return end aux.ToHandOrElse(tc,tp) if not tc:IsLocation(LOCATION_HAND|LOCATION_GRAVE) then return end local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp,tc) if #sg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=sg:Select(tp,1,1,nil):GetFirst() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control at least 1 face-up monster and have no monsters in your Graveyard, you can Special Summon this card from your hand. When this card is Special Summoned this way, this card's Level becomes equal to the total Levels of all other monsters you control. If the Level of this card is higher than 12, destroy this card.
--ミラー・レディバグ --Mirror Ladybug local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetValue(1) c:RegisterEffect(e1) --level change local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(s.lvcon) e2:SetOperation(s.lvop) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_SELF_DESTROY) e3:SetCondition(s.descon) c:RegisterEffect(e3) end function s.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,c:GetControler(),LOCATION_MZONE,0,1,nil) and not Duel.IsExistingMatchingCard(Card.IsMonster,c:GetControler(),LOCATION_GRAVE,0,1,nil) end function s.lvcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 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 g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,c) local lvs=g:GetSum(Card.GetLevel) if lvs~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(lvs) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.descon(e) return e:GetHandler():GetLevel()>12 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner monsters Once per turn, you can remove from play 1 Psychic-Type monster from your Graveyard to gain 1200 Life Points.
--サイコ・ヘルストランサー --Psychic Lifetrancer local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsRace(RACE_PSYCHIC) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1200) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1200) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time a Rock-Type monster is Normal Summoned, gain 500 LP. If a "Triamid" monster is Normal Summoned: You can draw 1 card, then discard 1 card. If this face-up card in the Field Zone is sent to the Graveyard: You can add 1 "Triamid" monster from your Deck to your hand. You can only use this effect of "Triamid Cruiser" once per turn.
--トラミッド・クルーザー --Triamid Cruiser local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --lp recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_FZONE) e2:SetTarget(s.lptg) e2:SetOperation(s.lpop) c:RegisterEffect(e2) --draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_FZONE) e3:SetTarget(s.drtg) e3:SetOperation(s.drop) c:RegisterEffect(e3) --to hand local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetDescription(aux.Stringid(id,2)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_TO_GRAVE) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCountLimit(1,id) e4:SetCondition(s.thcon) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) end s.listed_series={SET_TRIAMID} function s.lpfilter(c) return c:IsRace(RACE_ROCK) end function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(s.lpfilter,1,nil) end end function s.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode()) Duel.Recover(tp,500,REASON_EFFECT) end function s.drfilter(c) return c:IsSetCard(SET_TRIAMID) and c:IsMonster() end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(s.drfilter,1,nil) and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.Draw(tp,1,REASON_EFFECT)~=0 then Duel.ShuffleHand(tp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD) end end function s.thfilter(c) return c:IsSetCard(SET_TRIAMID) and c:IsMonster() and c:IsAbleToHand() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_FZONE) and c:IsPreviousPosition(POS_FACEUP) 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:
3 Fiend and/or Fairy monsters in your GY Monsters in your leftmost or rightmost Main Monster Zones cannot be destroyed by card effects. You can only use each of the following effects of "Luce the Dusk's Dark" once per turn. You can target 1 card your opponent controls; send 1 Fiend or Fairy monster from your Deck to the GY, and if you do, destroy that card. If another card(s) you control is destroyed by card effect (except during the Damage Step): You can target 1 card on the field; destroy it.
--Japanese name --Luce the Dusk's Dark --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials: 3 Fiend and/or Fairy monsters in your GY Fusion.AddProcMixN(c,true,true,s.fusionmatfilter,3) --Monsters in your leftmost or rightmost Main Monster Zones cannot be destroyed by card effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(function(e,c) return c:IsSequence(0,4) or (Duel.IsDuelType(DUEL_3_COLUMNS_FIELD) and c:IsSequence(1,3)) end) e1:SetValue(1) c:RegisterEffect(e1) --Send 1 Fiend or Fairy monster from your Deck to the GY, and if you do, destroy 1 card your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.tgdestg) e2:SetOperation(s.tgdesop) c:RegisterEffect(e2) --Destroy 1 card on the field local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end function s.fusionmatfilter(c,fc,sumtype,tp) return c:IsRace(RACE_FIEND|RACE_FAIRY,fc,sumtype,tp) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) end function s.tgfilter(c) return c:IsRace(RACE_FIEND|RACE_FAIRY) and c:IsAbleToGrave() end function s.tgdestg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.tgdesop(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 and Duel.SendtoGrave(g,REASON_EFFECT) and g:GetFirst():IsLocation(LOCATION_GRAVE) then local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end end function s.desconfilter(c,tp) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.desconfilter,1,nil,tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is used to Ritual Summon "Lord of the Red". You must also Tribute monsters from your hand or field, and/or banish "Red-Eyes" monsters from your GY, whose total Levels equal 8 or more.
--レッドアイズ・トランスマイグレーション --Red-Eyes Transmigration local s,id=GetID() function s.initial_effect(c) --Activate Ritual.AddProcGreater{handler=c,filter=s.ritualfil,lv=8,extrafil=s.extrafil,extratg=s.extratg} end s.listed_series={SET_RED_EYES} s.fit_monster={19025379} --should be removed in hardcode overhaul s.listed_names={19025379} function s.ritualfil(c) return c:IsCode(19025379) and c:IsRitualMonster() end function s.mfilter(c) return not Duel.IsPlayerAffectedByEffect(c:GetControler(),CARD_SPIRIT_ELIMINATION) and c:HasLevel() and c:IsSetCard(SET_RED_EYES) and c:IsMonster() and c:IsAbleToRemove() end function s.extrafil(e,tp,eg,ep,ev,re,r,rp,chk) return Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_GRAVE,0,nil) end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner Fiend monsters During your opponent's Main Phase (Quick Effect): You can target 1 Effect Monster on the field; discard 1 monster, and if you do, negate that monster's effect until the end of this turn. You can only use this effect of "Groza, Tyrant of Thunder" once per turn. If a Fiend monster(s) is sent from the hand to your GY (except during the Damage Step): You can apply 1 of the following effects to this card, until the end of this turn. ● Cannot be destroyed by battle. ● Cannot be destroyed by your opponent's card effects. ● Your opponent cannot target this card with card effects.
--迅雷の暴君 グローザー --Groza, Tyrant of Thunder local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Synchro summon procedure Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_FIEND),1,99) --During opponent's turn, negate 1 effect monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e1:SetCountLimit(1,id) e1:SetCondition(s.negcon) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) --Apply protection when a fiend sent from hand to GY local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.condition) e2:SetOperation(s.effop) c:RegisterEffect(e2) end function s.disfilter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled() end function s.dfilter(c) return c:IsMonster() and c:IsDiscardable() end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return s.disfilter(chkc) and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.DiscardHand(tp,s.dfilter,1,1,REASON_EFFECT|REASON_DISCARD)==0 then return end local c=e:GetHandler() local tc=Duel.GetFirstTarget() if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end end function s.cfilter(c,tp) return c:IsMonster() and c:IsRace(RACE_FIEND) and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_HAND) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g1=not c:IsHasEffect(EFFECT_INDESTRUCTABLE_BATTLE) local g2=not c:IsHasEffect(EFFECT_INDESTRUCTABLE_EFFECT) local g3=not c:IsHasEffect(EFFECT_CANNOT_BE_EFFECT_TARGET) return eg:IsExists(s.cfilter,1,nil,tp) and (g1 or g2 or g3) end function s.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local b1=not c:IsHasEffect(EFFECT_INDESTRUCTABLE_BATTLE) local b2=not c:IsHasEffect(EFFECT_INDESTRUCTABLE_EFFECT) local b3=not c:IsHasEffect(EFFECT_CANNOT_BE_EFFECT_TARGET) local dtab={} if b1 then table.insert(dtab,aux.Stringid(id,2)) end if b2 then table.insert(dtab,aux.Stringid(id,3)) end if b3 then table.insert(dtab,aux.Stringid(id,4)) end local opt=Duel.SelectOption(tp,table.unpack(dtab))+1 if not (b1 and b2) then opt=3 end if not (b1 and b3) then opt=2 end if (b1 and b3 and not b2 and opt==2) then opt=3 end if (b2 and b3 and not b1) then opt=opt+1 end if opt==1 then local e1=Effect.CreateEffect(c) e1:SetDescription(3000) --Cannot be destroyed by battle e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetOwnerPlayer(tp) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1) c:RegisterEffect(e1) elseif opt==2 then --Cannot be destroyed by opponent's card effects local e1=Effect.CreateEffect(c) e1:SetDescription(3060) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetValue(s.efilter) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) else --Cannot be targeted by opponent's card effects local e1=Effect.CreateEffect(c) e1:SetDescription(3061) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetValue(aux.tgoval) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end function s.efilter(e,re,rp) return e:GetHandlerPlayer()==1-rp end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While this card is in Defense Position, all Plant-Type monsters you control gain 500 ATK and DEF.
--妖精王オベロン --Fairy King Truesdale local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCondition(s.con) e1:SetTarget(s.tg) e1:SetValue(500) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetValue(500) c:RegisterEffect(e2) end function s.con(e) return e:GetHandler():IsDefensePos() end function s.tg(e,c) return c:IsRace(RACE_PLANT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you have 3 or more "Laval" monsters with different names in your Graveyard, you can Special Summon this card (from your hand).
--ラヴァル・コアトル --Laval Coatl 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) end s.listed_series={SET_LAVAL} function s.spcon(e,c) if c==nil then return true end if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end return Duel.GetMatchingGroup(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,SET_LAVAL):GetClassCount(Card.GetCode)>=3 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Fiend and/or Zombie monsters Once per turn, during your Standby Phase, pay 500 LP or destroy this card. Cannot be destroyed by battle. You can only use each of the following effects of "The Duke of Demise" once per turn. During your Main Phase, you can: Immediately after this effect resolves, Normal Summon 1 monster. You can banish this card from your GY, then target 1 Level 4 or higher Fiend or Zombie monster in your GY; add it to your hand.
--死霊公爵 --The Duke of Demise --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Material: 2 Fiend and/or Zombie monsters Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsRace,RACE_FIEND|RACE_ZOMBIE),2) --Maintenance cost: Pay 500 LP or destroy this card local e0=Effect.CreateEffect(c) e0:SetDescription(aux.Stringid(id,0)) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EVENT_PHASE|PHASE_STANDBY) e0:SetRange(LOCATION_MZONE) e0:SetCountLimit(1) e0:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) e0:SetOperation(s.maintop) c:RegisterEffect(e0) --Cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetValue(1) c:RegisterEffect(e1) --Normal Summon 1 monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.nstg) e2:SetOperation(s.nsop) c:RegisterEffect(e2) --Add 1 Level 4 or higher Fiend or Zombie monster from your GY to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end function s.maintop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local b1=Duel.CheckLPCost(tp,500) local b2=true --Pay 500 LP or destroy this card local op=b1 and Duel.SelectEffect(tp, {b1,aux.Stringid(id,3)}, {b2,aux.Stringid(id,4)}) or 2 if op==1 then Duel.PayLPCost(tp,500) elseif op==2 then Duel.Destroy(e:GetHandler(),REASON_COST) end end function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSummonable,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,true,nil) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) end function s.nsop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local sc=Duel.SelectMatchingCard(tp,Card.IsSummonable,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,true,nil):GetFirst() if sc then Duel.Summon(tp,sc,true,nil) end end function s.thfilter(c) return c:IsLevelAbove(4) and c:IsRace(RACE_FIEND|RACE_ZOMBIE) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=c and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) 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:
If this card destroys a LIGHT monster by battle and sends it to the GY: Draw 1 card, then if you drew a Level 4 or lower DARK monster, you can reveal that card and Special Summon it.
--A・O・J リーサル・ウェポン --Ally of Justice Omni-Weapon local s,id=GetID() function s.initial_effect(c) --check local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_BATTLED) e1:SetOperation(s.checkop) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) e2:SetLabelObject(e1) c:RegisterEffect(e2) end function s.checkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetAttacker() if tc==c then tc=Duel.GetAttackTarget() end if tc and tc:IsAttribute(ATTRIBUTE_LIGHT) then e:SetLabel(1) else e:SetLabel(0) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) local dg=eg:GetFirst() return #eg==1 and dg:IsLocation(LOCATION_GRAVE) and dg:IsReason(REASON_BATTLE) and dg:IsAttribute(ATTRIBUTE_LIGHT) and dg:GetReasonCard()==e:GetHandler() and e:GetLabelObject():GetLabel()==1 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.Draw(tp,1,REASON_EFFECT) if ct==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetOperatedGroup():GetFirst() if tc:GetLevel()<=4 and tc:IsAttribute(ATTRIBUTE_DARK) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.ConfirmCards(1-tp,tc) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Special Summoned. When this card is Normal Summoned or flipped face-up: You can target 1 Level 1 monster in your GY; Special Summon that target, but banish it when this card leaves the field. Once per turn, during the End Phase, if this card was Normal Summoned or flipped face-up this turn: Return it to the hand.
--金華猫 --Kinka-byo local s,id=GetID() function s.initial_effect(c) Spirit.AddProcedure(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP) --Cannot be Special Summoned 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 1 Level 1 monster 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP) c:RegisterEffect(e3) --Banish Special Summoned monster local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetOperation(s.leave) c:RegisterEffect(e4) e2:SetLabelObject(e4) e3:SetLabelObject(e4) end function s.spfilter(c,e,tp) return c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) then c:SetCardTarget(tc) e:GetLabelObject():SetLabelObject(tc) c:CreateRelation(tc,RESET_EVENT|RESET_OVERLAY|RESET_TOFIELD|RESET_TURN_SET) tc:CreateRelation(c,RESET_EVENT|RESETS_STANDARD) end end function s.leave(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=e:GetLabelObject() if tc and c:IsRelateToCard(tc) and tc:IsRelateToCard(c) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) by having only Machine-Type monsters in your Graveyard (min. 1). Once per turn: You can target 1 face-up monster your opponent controls; its ATK becomes 0 until the End Phase.
--ネジマキシキガミ --Gearspring Spirit local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.cfilter(c) return c:GetRace()~=RACE_MACHINE end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end local g=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_GRAVE,0,nil) return #g>0 and not g:IsExists(s.cfilter,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) 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_SET_ATTACK_FINAL) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(0) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Cyberse monsters If this card is Link Summoned: You can Special Summon 1 Cyberse monster from your hand to your zone this card points to. You can only use this effect of "Code Talker Inverted" once per turn.
--コード・トーカー・インヴァート --Code Talker Inverted --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,2) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) 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():IsLinkSummoned() end function s.filter(c,e,tp,zone) return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone(tp) return zone~=0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone(tp) if zone==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal Summoned: Place 2 Spell Counters on it. Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell resolves. Gains 300 ATK for each Spell Counter on it. Once per turn: You can remove 2 Spell Counters from this card; discard 1 random card from your opponent's hand.
--闇紅の魔導師 --Dark Red Enchanter local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_SPELL) --summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.addct) e1:SetOperation(s.addc) c:RegisterEffect(e1) --add counter local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetCode(EVENT_CHAINING) e0:SetRange(LOCATION_MZONE) e0:SetOperation(aux.chainreg) c:RegisterEffect(e0) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetRange(LOCATION_MZONE) e2:SetOperation(s.acop) c:RegisterEffect(e2) --attackup local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetValue(s.attackup) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_HANDES) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCost(s.descost) e4:SetTarget(s.destarg) e4:SetOperation(s.desop) c:RegisterEffect(e4) end s.counter_place_list={COUNTER_SPELL} function s.addct(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,COUNTER_SPELL) end function s.addc(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then e:GetHandler():AddCounter(COUNTER_SPELL,2) end end function s.acop(e,tp,eg,ep,ev,re,r,rp) if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and e:GetHandler():GetFlagEffect(1)>0 then e:GetHandler():AddCounter(COUNTER_SPELL,1) end end function s.attackup(e,c) return c:GetCounter(COUNTER_SPELL)*300 end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,COUNTER_SPELL,2,REASON_COST) end e:GetHandler():RemoveCounter(tp,COUNTER_SPELL,2,REASON_COST) end function s.destarg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil) if #g==0 then return end local sg=g:RandomSelect(1-tp,1) Duel.SendtoGrave(sg,REASON_DISCARD|REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters During your opponent's turn (Quick Effect): You can target 1 Fusion, Synchro, Xyz, or Link Monster on the field, or if your LP are lower than your opponent's, you can target 2; destroy them. You can only use this effect of "Gold Pride - Eradicator" once per turn. Once per turn, during the End Phase, if the previous effect was activated this turn: Return this card to the Extra Deck, and if you do, Special Summon 1 "Gold Pride - Eliminator" from your Deck or GY.
--GP-アニヒレーター --Gold Pride - Eradicator --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Synchro Summon Procedure Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --Destroy 1 monster on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetCondition(function(_,tp) return Duel.IsTurnPlayer(1-tp) end) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Return itself to the Extra Deck and Special Summon "Gold Pride - Assassinator" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={60203670} --Gold Pride - Assassinator function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsType(TYPE_EXTRA) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsType,TYPE_EXTRA),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end local ct=(Duel.GetLP(tp)<Duel.GetLP(1-tp)) and 2 or 1 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsType,TYPE_EXTRA),tp,LOCATION_MZONE,LOCATION_MZONE,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) --Register that this effect was activated this turn e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_OATH,1) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end function s.spfilter(c,e,tp) return c:IsCode(60203670) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsAbleToExtra() and Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as a "Blue-Eyes" card.) This card is treated as a Normal Monster while in the hand or GY. When this card is Normal or Special Summoned: You can target 1 Spell/Trap your opponent controls; banish it. If your opponent controls a monster (Quick Effect): You can Tribute this card; Special Summon 1 "Blue-Eyes White Dragon" from your hand.
--白き霊龍 --Dragon Spirit of White local s,id=GetID() function s.initial_effect(c) --Normal monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetValue(TYPE_NORMAL) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_REMOVE_TYPE) e2:SetValue(TYPE_EFFECT) c:RegisterEffect(e2) --Remove local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) --Special Summon local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetHintTiming(0,TIMING_END_PHASE) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) e5:SetCondition(s.spcon) e5:SetCost(Cost.SelfTribute) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) end s.listed_names={CARD_BLUEEYES_W_DRAGON} function s.rmfilter(c) return c:IsSpellTrap() and c:IsAbleToRemove() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and s.rmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end function s.spfilter(c,e,tp) return c:IsCode(CARD_BLUEEYES_W_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if e:GetHandler():GetSequence()<5 then ft=ft+1 end if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the GY to activate a WATER monster's effect: You can make your opponent banish 1 card from their hand face-up, until the End Phase. If this card is Special Summoned: You can send the top 2 cards of your Deck to the GY, then target 1 Level 4 or lower WATER monster in your GY, except "Deep Sea Sentry"; add it to your hand. You can only use each effect of "Deep Sea Sentry" once per turn.
--深海のセントリー --Deep Sea Sentry --Scripted by Naim local s,id=GetID() function s.initial_effect(c) --Make the opponent banish 1 monster from the hand 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:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.rmcond) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Add 1 Level 4 or Lower WATER monster from the from GY to the hand 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:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.tdcost) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end s.listed_names={id} function s.rmcond(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsMonsterEffect() and re:GetHandler():IsAttribute(ATTRIBUTE_WATER) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,1-tp) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if Duel.IsPlayerAffectedByEffect(1-tp,30459350) or #hg==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=hg:Select(1-tp,1,1,nil) local tc=g:GetFirst() Duel.Remove(g,POS_FACEUP,REASON_EFFECT,PLAYER_NONE,1-tp) Duel.ShuffleHand(1-tp) local c=e:GetHandler() local fid=c:GetFieldID() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetLabel(fid) e1:SetLabelObject(tc) e1:SetCondition(s.retcon) e1:SetOperation(s.retop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid) end function s.retcon(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.retop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.SendtoHand(tc,nil,REASON_EFFECT) end function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end Duel.DiscardDeck(tp,2,REASON_COST) end function s.thfilter(c) return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand() and not c:IsCode(id) end function s.tdtg(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_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=tg:Filter(Card.IsRelateToEffect,nil,e) if #sg>0 then Duel.SendtoHand(sg,tp,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you have a Fusion Monster that mentions "Fallen of Albaz" as material on your field or in your GY: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can add to your hand, 1 of your "Branded" Spells/Traps that is banished or in your Deck or GY, then place 1 card from your hand on the bottom of the Deck. You can only use each effect of "Springans Kitt" once per turn.
--スプリガンズ・キット --Springans Kitt --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Add to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_names={CARD_ALBAZ} s.listed_series={SET_BRANDED} function s.spconfilter(c) return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:ListsCodeAsMaterial(CARD_ALBAZ) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,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.thfilter(c) return c:IsSetCard(SET_BRANDED) and c:IsSpellTrap() and c:IsAbleToHand() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED) 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 tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil):GetFirst() if not (tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND)) then return end Duel.ConfirmCards(1-tp,tc) Duel.ShuffleHand(tp) if tc:IsPreviousLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local td=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil) if #td>0 then Duel.DisableShuffleCheck() Duel.BreakEffect() Duel.SendtoDeck(td,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This linked card cannot be destroyed by battle. You can only use each of the following effects of "NT8000 - SIRIUS" once per turn. During the turn a Link Monster's effect was activated (Quick Effect): You can target 1 face-up card you control and 1 face-up card your opponent controls; destroy both. If this card is sent to the GY, except from the field, and you control a DARK Link Monster: You can Special Summon this card, but banish it when it leaves the field.
--NT8000-SIRIUS --NT8000 - SIRIUS --scripted by Naim local s,id=GetID() function s.initial_effect(c) --This linked card cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e) return e:GetHandler():IsLinked() end) e1:SetValue(1) c:RegisterEffect(e1) --Destroy 1 face-up card you control and 1 face-up card your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,id) e2:SetCondition(function() return Duel.GetCustomActivityCount(id,0,ACTIVITY_CHAIN)>0 or Duel.GetCustomActivityCount(id,1,ACTIVITY_CHAIN)>0 end) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) --Check if the effect of a Link Monster was activated this turn Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,function(re) return not re:GetHandler():IsLinkMonster() end) --Special Summon this card from the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(function(e) return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCanBeEffectTarget,e),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local dg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_DESTROY) Duel.SetTargetCard(dg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg==2 then Duel.Destroy(tg,REASON_EFFECT) end end function s.darklinkfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsLinkMonster() and c:IsFaceup() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.darklinkfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can Special Summon 1 "Super Defense Robot" monster or "Orbital 7" from your hand. Once per turn: You can target 1 "Super Defense Robot" monster or "Orbital 7" you control; it becomes Level 8 until the end of this turn. This card cannot be used as an Xyz Material for an Xyz Summon, except for the Xyz Summon of a Machine-Type monster.
--SDロボ・エレファン --Super Defense Robot Elephan local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) c:RegisterEffect(e1) --lvchange local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.lvtg) e2:SetOperation(s.lvop) c:RegisterEffect(e2) --xyzlimit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetValue(s.xyzlimit) c:RegisterEffect(e3) end s.listed_series={SET_SUPER_DEFENSE_ROBOT} s.listed_names={71071546} function s.filter(c,e,tp) return (c:IsSetCard(SET_SUPER_DEFENSE_ROBOT) or c:IsCode(71071546)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.lvfilter(c) return c:IsFaceup() and (c:IsSetCard(SET_SUPER_DEFENSE_ROBOT) or c:IsCode(71071546)) and c:GetLevel()~=8 end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(8) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.xyzlimit(e,c) if not c then return false end return not c:IsRace(RACE_MACHINE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner Plant-Type monsters Each player must pay 1000 LP for each monster Normal or Special Summoned from their hand, except for Plant-Type monsters.
--ヘル・ブランブル --Queen of Thorns local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_PLANT),1,99) c:EnableReviveLimit() --cost local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SUMMON_COST) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e1:SetTarget(s.sumtg) e1:SetCost(s.ccost) e1:SetOperation(s.acop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SPSUMMON_COST) c:RegisterEffect(e2) end function s.sumtg(e,c) return c:GetRace()~=RACE_PLANT end function s.ccost(e,c,tp) return Duel.CheckLPCost(tp,1000) end function s.acop(e,tp,eg,ep,ev,re,r,rp) Duel.PayLPCost(tp,1000) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot attack while you have any cards in your hand. Once per turn: You can Special Summon 1 "Celtic Guard" monster from your hand. When this attacking card inflicts battle damage to your opponent: You can draw cards equal to the number of "Celtic Guard" monsters you control.
--エルフの聖剣士 --Celtic Guard of Noble Arms local s,id=GetID() function s.initial_effect(c) --cannot attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCondition(s.atcon) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --draw local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DRAW) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCondition(s.drcon) e3:SetTarget(s.drtg) e3:SetOperation(s.drop) c:RegisterEffect(e3) end s.listed_series={SET_CELTIC_GUARD} function s.atcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)>=1 end function s.spfilter(c,e,tp) return c:IsSetCard(SET_CELTIC_GUARD) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and Duel.GetAttacker()==e:GetHandler() end function s.drfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CELTIC_GUARD) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_MZONE,0,nil) Duel.Draw(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
3 Level 5 Winged Beast-Type monsters This card can attack directly while it has Xyz Material. When this card inflicts battle damage to your opponent: You can target 1 monster your opponent controls; destroy it. Once per turn: You can detach 1 Xyz Material from this card; destroy as many Special Summoned monsters your opponent controls as possible, and if you do, inflict 500 damage to your opponent for each monster destroyed.
--RR-ブレイズ・ファルコン --Raidraptor - Blaze Falcon local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WINGEDBEAST),5,3) c:EnableReviveLimit() --direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCondition(s.dacon) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCondition(s.descon) e2:SetTarget(s.destg1) e2:SetOperation(s.desop1) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCost(Cost.DetachFromSelf(1)) e3:SetTarget(s.destg2) e3:SetOperation(s.desop2) c:RegisterEffect(e3) end function s.dacon(e) return e:GetHandler():GetOverlayCount()>0 end function s.descon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function s.destg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop1(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.filter(c) return c:IsSpecialSummoned() end function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#g*500) end function s.desop2(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) local ct=Duel.Destroy(sg,REASON_EFFECT) if ct>0 then Duel.Damage(1-tp,ct*500,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is destroyed by battle and sent to the GY: You can add 1 "Harpie Lady" from your Deck to your hand.
--バード・フェイス --Birdface local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={CARD_HARPIE_LADY} function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) end function s.filter(c) return c:IsCode(CARD_HARPIE_LADY) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If all monsters you control are "Valkyrie" monsters: Target 1 Attack Position "Valkyrie" monster you control and 1 face-up monster your opponent controls; change your monster to Defense Position, and if you do, banish that opponent's monster. You cannot Special Summon monsters the turn you activate this card, except "Valkyrie" monsters. You can only activate 1 "Valkyrie's Embrace" per turn.
--ワルキューレの抱擁 --Valkyrie's Embrace --Scripted by Naim local s,id=GetID() function s.initial_effect(c) --Change 1 of your "Valkyrie" monsters to defense position, banish 1 of opponent's monsters local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_POSITION+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end s.listed_series={SET_VALKYRIE} function s.counterfilter(c) return c:IsSetCard(SET_VALKYRIE) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH) e2:SetDescription(aux.Stringid(id,1)) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(SET_VALKYRIE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(aux.NOT(Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,SET_VALKYRIE) end function s.filter(c) return c:IsSetCard(SET_VALKYRIE) and c:IsFaceup() and c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition() end 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(s.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAbleToRemove,nil),tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g1=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g1,1,0,0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g2=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAbleToRemove,nil),tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g2,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local ex1,tg1=Duel.GetOperationInfo(0,CATEGORY_POSITION) local ex2,tg2=Duel.GetOperationInfo(0,CATEGORY_REMOVE) if tg1:GetFirst() and tg1:GetFirst():IsRelateToEffect(e) and Duel.ChangePosition(tg1,POS_FACEUP_DEFENSE)~=0 and tg2:GetFirst() and tg2:GetFirst():IsRelateToEffect(e) then Duel.Remove(tg2,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can discard 1 card from your hand to return Spell/Trap Cards from the field to the hand equal to the number of face-up Tuner monsters on the field.
--A・O・J サイクロン・クリエイター --Ally of Justice Cyclone Creator local s,id=GetID() function s.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD,nil) end function s.cfilter(c) return c:IsFaceup() and c:IsType(TYPE_TUNER) end function s.rfilter(c) return c:IsSpellTrap() and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if chk==0 then return Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,nil) end local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,rg,ct,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if #rg<ct then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local sg=rg:Select(tp,ct,ct,nil) Duel.HintSelection(sg) Duel.SendtoHand(sg,nil,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] During your Main Phase: You can inflict 300 damage to your opponent for each face-up Pendulum Monster in your Extra Deck. You can only use this effect of "Performapal Extra Slinger" once per turn. You cannot Pendulum Summon the turn you activate this effect. ---------------------------------------- [ Monster Effect ] Once per turn: You can banish 1 card from your Extra Deck, then target 1 card in a Pendulum Zone; destroy it, and if you do, inflict 300 damage to your opponent.
--EMエクストラ・シューター --Performapal Extra Slinger local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) --Damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1,id) e1:SetCost(s.dmcost) e1:SetTarget(s.dmtg) e1:SetOperation(s.dmop) c:RegisterEffect(e1) --Destroy and inflict damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetCost(s.descost) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return not c:IsPendulumSummoned() end function s.dmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function s.dmfilter(c) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) end function s.dmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.dmfilter,tp,LOCATION_EXTRA,0,1,nil) end local dam=Duel.GetMatchingGroupCount(s.dmfilter,tp,LOCATION_EXTRA,0,nil)*300 Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.dmop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=Duel.GetMatchingGroupCount(s.dmfilter,tp,LOCATION_EXTRA,0,nil)*300 Duel.Damage(p,d,REASON_EFFECT) end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_PZONE) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,LOCATION_PZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_PZONE,LOCATION_PZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,300,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
● While in Attack Position: Once per turn, if you control exactly 2 other face-up Attack Position monsters, and no additional monsters, this card gains the combined ATK of the other two monsters you control until the End Phase. The other monsters cannot attack the turn you activate this effect. ● While in Defense Position: Monsters you control cannot attack.
--D・マグネンI --Morphtronic Magnen Bar local s,id=GetID() function s.initial_effect(c) --atk local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.cona) e1:SetTarget(s.tga) e1:SetOperation(s.opa) c:RegisterEffect(e1) --def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCondition(s.cond) c:RegisterEffect(e2) end function s.cfilter(c) return c:IsFaceup() and c:IsAttackPos() end function s.cona(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsDisabled() and e:GetHandler():IsAttackPos() and Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,e:GetHandler())==2 and not Duel.IsExistingMatchingCard(Card.IsDefensePos,tp,LOCATION_MZONE,0,1,e:GetHandler()) end function s.tga(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local c=e:GetHandler() local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,c) Duel.SetTargetCard(g) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_OATH) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.ftarget) e1:SetLabel(c:GetFieldID()) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.ftarget(e,c) return e:GetLabel()~=c:GetFieldID() end function s.filter(c,e) return c:IsFaceup() and c:IsRelateToEffect(e) end function s.opa(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(s.filter,nil,e) if #sg==0 then return end local atk=sg:GetSum(Card.GetAttack) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end 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 function s.cond(e) return e:GetHandler():IsDefensePos() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a monster that is not a "Burning Abyss" monster, destroy this card. You can only use 1 of these effects of "Draghig, Malebranche of the Burning Abyss" per turn, and only once that turn. ● If you control no Spell/Trap Cards: You can Special Summon this card from your hand. ● If this card is sent to the Graveyard: You can choose 1 "Burning Abyss" card from your Deck and place it on top of your Deck.
--彼岸の悪鬼 ドラゴネル --Draghig, Malebranche of the Burning Abyss local s,id=GetID() function s.initial_effect(c) --self destroy local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_SELF_DESTROY) e1:SetCondition(s.sdcon) c:RegisterEffect(e1) --Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCondition(s.sscon) e2:SetTarget(s.sstg) e2:SetOperation(s.ssop) c:RegisterEffect(e2) --to deck top 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_TO_GRAVE) e3:SetCountLimit(1,id) e3:SetTarget(s.dttg) e3:SetOperation(s.dtop) c:RegisterEffect(e3) end s.listed_series={SET_BURNING_ABYSS} function s.sdfilter(c) return not c:IsFaceup() or not c:IsSetCard(SET_BURNING_ABYSS) end function s.sdcon(e) return Duel.IsExistingMatchingCard(s.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.filter(c) return c:IsSpellTrap() end function s.sscon(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) end function s.sstg(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.ssop(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.dttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,SET_BURNING_ABYSS) end end function s.dtop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,SET_BURNING_ABYSS) local tc=g:GetFirst() if tc then Duel.ShuffleDeck(tp) Duel.MoveSequence(tc,0) Duel.ConfirmDecktop(tp,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send this card from your hand to the Graveyard to target 1 face-up monster on the field; increase that target's Level by 1, until the End Phase.
--騒々虫 --Noisy Gnat local s,id=GetID() function s.initial_effect(c) --lvup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.lvtg) e1:SetOperation(s.lvop) c:RegisterEffect(e1) end function s.lvfilter(c) return c:IsFaceup() and not c:IsType(TYPE_XYZ) end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Once per turn, if you have no cards in your other Pendulum Zone: You can place 1 Pendulum Monster from your Deck in your Pendulum Zone. ---------------------------------------- [ Monster Effect ] 2 Level 7 Dragon-Type monsters If you can Pendulum Summon Level 7, you can Pendulum Summon this face-up card in your Extra Deck. If this card is Xyz Summoned by using an Xyz Monster as material: Destroy as many Level 7 or lower monsters your opponent controls as possible, and if you do, inflict 1000 damage to your opponent for each card destroyed, also this card can make 3 attacks during each Battle Phase this turn. If this card in the Monster Zone is destroyed by battle or card effect: You can destroy as many cards in your Pendulum Zones as possible (min. 1), and if you do, place this card in your Pendulum Zone.
--覇王黒竜オッドアイズ・リベリオン・ドラゴン --Odd-Eyes Rebellion Dragon local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2) c:EnableReviveLimit() --pendulum summon Pendulum.AddProcedure(c,false) --pendulum set local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1) e1:SetTarget(s.pctg) e1:SetOperation(s.pcop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_MATERIAL_CHECK) e3:SetValue(s.valcheck) e3:SetLabelObject(e2) c:RegisterEffect(e3) --pendulum local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCondition(s.pencon) e4:SetTarget(s.pentg) e4:SetOperation(s.penop) c:RegisterEffect(e4) end s.pendulum_level=7 function s.pcfilter(c) return c:IsType(TYPE_PENDULUM) and not c:IsForbidden() end function s.pctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) and Duel.IsExistingMatchingCard(s.pcfilter,tp,LOCATION_DECK,0,1,nil) end end function s.pcop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if not Duel.CheckPendulumZones(tp) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local g=Duel.SelectMatchingCard(tp,s.pcfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() and e:GetLabel()==1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsLevelBelow,7),tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#g*1000) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsLevelBelow,7),tp,0,LOCATION_MZONE,nil) local ct=Duel.Destroy(g,REASON_EFFECT) if Duel.Damage(1-tp,ct*1000,REASON_EFFECT)~=0 then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,3)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(2) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end function s.valcheck(e,c) local g=c:GetMaterial() if g:IsExists(Card.IsType,1,nil,TYPE_XYZ,c,SUMMON_TYPE_XYZ) then e:GetLabelObject():SetLabel(1) else e:GetLabelObject():SetLabel(0) end end function s.pencon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (r&REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0 end local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.penop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can target 1 Level 1 LIGHT Tuner in your GY; add it to your hand. You can shuffle this card from your GY into the Deck, then target 1 Effect Monster you control; send it to the GY, and if you do, Special Summon 1 "Blue-Eyes" monster from your GY, other than the sent monster. You can only use this effect of "Master with Eyes of Blue" once per turn.
--青き眼の祭司 --Master with Eyes of Blue local s,id=GetID() function s.initial_effect(c) --Add 1 Level 1 LIGHT Tuner 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_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Send 1 Effect Monster you control to the GY, and if you do, Special Summon 1 "Blue-Eyes" monster from your GY, other than the sent monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfToDeck) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_BLUE_EYES} function s.thfilter(c) return c:IsLevel(1) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_TUNER) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.tgfilter(c,tp) return c:IsType(TYPE_EFFECT) and c:IsFaceup() and c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c)>0 end function s.spfilter(c,e,tp) return c:IsSetCard(SET_BLUE_EYES) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsMonster() and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,tc,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent controls a monster and you control a Level 3 monster, you can Special Summon this card (from your hand). You can only Special Summon "Mimimic" once per turn this way.
--ミミミック --Mimimic 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) end function s.filter(c) return c:IsFaceup() and c:GetLevel()==3 end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE,nil)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Cloudian" monster you control; reduce its ATK by exactly 1000 or 2000, and if you do, apply the appropriate effect. ● 1000: Destroy 1 Spell/Trap your opponent controls. ● 2000: Destroy 2 cards your opponent controls.
--暴風雨 --Rain Storm 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_CLOUDIAN} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CLOUDIAN) and c:IsAttackAbove(1000) 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.cfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.filter1(c) return c:IsSpellTrap() end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local atk=tc:GetAttack() local g1=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_ONFIELD,nil) local g2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) local opt=0 local b1=atk>=1000 and #g1>0 local b2=atk>=2000 and #g2>1 if b1 and b2 then opt=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) elseif b1 then opt=Duel.SelectOption(tp,aux.Stringid(id,0)) elseif b2 then opt=Duel.SelectOption(tp,aux.Stringid(id,1))+1 else opt=2 end if opt==0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-1000) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g1:Select(tp,1,1,nil) Duel.Destroy(dg,REASON_EFFECT) elseif opt==1 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-2000) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g2:Select(tp,2,2,nil) Duel.Destroy(dg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Magikey" monster + 1 Normal Monster, except a Token If this card is Fusion Summoned: You can add 1 "Magikey Maftea" from your GY to your hand. You can only use this effect of "Magikey Beast - Ansyalabolas" once per turn. Once per turn: You can target 1 Attack Position monster your opponent controls with the same Attribute as a Normal Monster or "Magikey" monster in your GY; change it to Defense Position, and if you do, it loses 1000 DEF. Banish any monster destroyed by battle with this card.
--魔鍵召獣-アンシャラボラス --Magikey Beast - Ansyalabolas --script by V.J.Wilson local s,id=GetID() function s.initial_effect(c) --Fusion summoned properly if to be revived by effect c:EnableReviveLimit() --Fusion Proc Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_MAGIKEY),s.matfilter) --Return fusion spell 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:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --change position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_POSITION+CATEGORY_DEFCHANGE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.postg) e2:SetOperation(s.posop) c:RegisterEffect(e2) --banish local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT) e3:SetValue(LOCATION_REMOVED) c:RegisterEffect(e3) end s.listed_names={99426088} s.listed_series={SET_MAGIKEY} function s.matfilter(c,fc,sumtype,tp) return c:IsType(TYPE_NORMAL,fc,sumtype,tp) and not c:IsType(TYPE_TOKEN,fc,sumtype,tp) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsFusionSummoned() end function s.thfilter(c) return c:IsCode(99426088) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end --check for attack pos monster function s.atkfilter(c) return c:IsMonster() and (c:IsType(TYPE_NORMAL) or c:IsSetCard(SET_MAGIKEY)) end function s.posfilter(c,tp) if c:IsFaceup() and c:IsAttackPos() and c:IsCanChangePosition() then local att=0 for gc in aux.Next(Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_GRAVE,0,nil)) do att=att|gc:GetAttribute() end return c:GetAttribute()&att~=0 end end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.posfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,0,LOCATION_MZONE,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectTarget(tp,s.posfilter,tp,0,LOCATION_MZONE,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,0,0) end function s.posop(e,tp,ev,eg,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsAttackPos() and tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) if tc:IsPosition(POS_FACEUP_DEFENSE) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_DEFENSE) e1:SetValue(-1000) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish this card from your GY; Special Summon 1 "Evil HERO" monster from your hand or Deck, except "Evil HERO Sinister Necrom". You can only use this effect of "Evil HERO Sinister Necrom" once per turn.
--E-HERO シニスター・ネクロム --Evil HERO Sinister Necrom --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_names={id} s.listed_series={SET_EVIL_HERO} function s.spfilter(c,e,tp) return c:IsSetCard(SET_EVIL_HERO) 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|LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is face-up on the field, you can Normal Summon it to have it become an Effect Monster with this effect. ● Once per turn: You can banish 1 "Gem-" monster from your Graveyard to target 1 "Gem-Knight" card in your Graveyard; add that target to your hand.
--ジェムナイト・アイオーラ --Gem-Knight Iolite local s,id=GetID() function s.initial_effect(c) Gemini.AddProcedure(c) --Add 1 "Gem-Knight" card to the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(Gemini.EffectStatusCondition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GEM,SET_GEM_KNIGHT} function s.tgfilter(c) return c:IsSetCard(SET_GEM_KNIGHT) and c:IsAbleToHand() end function s.costfilter(c,tp) return c:IsSetCard(SET_GEM) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_GRAVE,0,1,c) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local cg=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) Duel.Remove(cg,POS_FACEUP,REASON_COST) 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.tgfilter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can target 1 of your Level 1 FIRE monsters that is banished or in your GY; either add it to your hand or Special Summon it. You can send 2 face-up cards you control to the GY, including this card; Special Summon 1 "Snake-Eye" monster from your hand or Deck, except "Snake-Eye Oak". You can only use each effect of "Snake-Eye Oak" once per turn.
--スネークアイ・オーク --Snake-Eye Oak --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Snake-Eye" monster from your hand or Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.thsptg) e1:SetOperation(s.thspop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Special Summon 1 "Snake-Eye" monster from your hand or Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_names={id} s.listed_series={SET_SNAKE_EYE} function s.thspfilter(c,e,tp,ft) return c:IsLevel(1) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup() and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chkc then return chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and chkc:IsControler(tp) and s.thspfilter(chkc,e,tp,ft) end if chk==0 then return Duel.IsExistingTarget(s.thspfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp,ft) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.thspfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp,ft) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) if g:GetFirst():IsLocation(LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) end end function s.thspop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end aux.ToHandOrElse(tc,tp, function() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, function() Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,2) --"Special Summon it" ) end function s.cfilter(c,tp,forced) return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.FromCards(c,forced))>0 end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,c,tp,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp,c) g:AddCard(c) Duel.SendtoGrave(g,REASON_COST) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_SNAKE_EYE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 of your "Nemeses" monsters that is banished or in your GY; Special Summon it, but if its original Level is 11 or higher, it cannot activate its effects this turn. You can only activate 1 "Nemeses Adrastea" per turn.
--星義の執行者 --Nemeses Adrastea --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Special summon 1 of your "Nemeses" monsters, that is banished or in GY 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:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_NEMESES} function s.spfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_NEMESES) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) 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,LOCATION_GRAVE|LOCATION_REMOVED) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc:GetOriginalLevel()>=11 then --Cannot activate its effects local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3302) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Once per turn: You can target 1 face-up monster on the field; it becomes Dragon-Type until the end of your opponent's turn (even if this card leaves the field). ---------------------------------------- [ Monster Effect ] Once per turn: You can make this card become Dragon-Type until the end of this turn. A monster that was Fusion, Synchro, or Xyz Summoned using this card on the field as Material gains this effect. ● If this card battles a Dragon-Type monster, this card's ATK becomes double its original ATK during the Damage Step only.
--降竜の魔術師 --Dragoncaller Magician local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --change race local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_PZONE) e1:SetTarget(s.rctg1) e1:SetOperation(s.rcop1) c:RegisterEffect(e1) --change race local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.rctg2) e2:SetOperation(s.rcop2) c:RegisterEffect(e2) --effect gain local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_BE_MATERIAL) e3:SetCondition(s.efcon) e3:SetOperation(s.efop) c:RegisterEffect(e3) end function s.rcfilter(c) return c:IsFaceup() and not c:IsRace(RACE_DRAGON) end function s.rctg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.rcfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rcfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.rcfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.rcop1(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 tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetValue(RACE_DRAGON) e1:SetReset(RESETS_STANDARD_PHASE_END,2) tc:RegisterEffect(e1) end end function s.rctg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsRace(RACE_DRAGON) end end function s.rcop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetValue(RACE_DRAGON) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end end function s.efcon(e,tp,eg,ep,ev,re,r,rp) return (r&REASON_FUSION+REASON_SYNCHRO+REASON_XYZ)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.efop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() local e1=Effect.CreateEffect(rc) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) e1:SetValue(s.atkval) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1,true) if not rc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e2,true) end end function s.atkcon(e) local ph=Duel.GetCurrentPhase() local bc=e:GetHandler():GetBattleTarget() return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and bc and bc:IsRace(RACE_DRAGON) end function s.atkval(e,c) return e:GetHandler():GetBaseAttack()*2 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is added to your hand, except by drawing it: You can Special Summon it, also you cannot Special Summon for the rest of this turn, except Machine monsters. If this card is Normal or Special Summoned: You can send 1 "Machina" monster from your Deck to the GY, except "Machina Unclaspare". You can only use each effect of "Machina Unclaspare" once per turn.
--マシンナーズ・アンクラスペア --Machina Unclaspare --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --If normal or special summoned, send 1 "Machina" monster from deck to GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end --Lists "Machina" archetype s.listed_series={SET_MACHINA} --Specifically lists itself s.listed_names={id} --If added to hand besides drawing function s.spcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsReason(REASON_DRAW) end --Activation legality 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 --Special summon itself from hand, restricted to machine monsters for rest of turn 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) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e2:SetDescription(aux.Stringid(id,2)) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) end function s.splimit(e,c,sump,sumtype,sumpos,targetp) return not c:IsRace(RACE_MACHINE) end --Check for "Machina" monster, except "Machina Unclasspare" function s.tgfilter(c) return c:IsMonster() and c:IsSetCard(SET_MACHINA) and not c:IsCode(id) and c:IsAbleToGrave() end --Activation legality 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 --Send 1 "Machina" monster from deck to GY 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:
During either player's turn, you can: Immediately after this effect resolves, Synchro Summon 1 Synchro Monster, using monsters you control as material, including a Dragon monster. You can only use this effect of "Etude of the Branded" once per turn. While you control a "Bystial" monster, banish any monsters that would be sent to your opponent's GY as Tributes for their Ritual Summon, or as material for their Fusion, Synchro, or Link Summon.
--烙印の即凶劇 --Etude of the Branded --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Synchro Summon using a Dragon monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,id) e2:SetTarget(s.sctg) e2:SetOperation(s.scop) c:RegisterEffect(e2) --Banished instead local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e3:SetCode(EFFECT_TO_GRAVE_REDIRECT) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(0,LOCATION_ALL) e3:SetCondition(s.rmcon) e3:SetTarget(s.rmtg) e3:SetValue(LOCATION_REMOVED) c:RegisterEffect(e3) end s.listed_series={SET_BYSTIAL} function s.checkaddition(tp,sg,sc) return sg:IsExists(Card.IsRace,1,nil,RACE_DRAGON) end function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then Synchro.CheckAdditional=s.checkaddition local res=Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil) Synchro.CheckAdditional=nil return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.scop(e,tp,eg,ep,ev,re,r,rp) Synchro.CheckAdditional=s.checkaddition local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SynchroSummon(tp,sg:GetFirst()) else Synchro.CheckAdditional=nil end end function s.rmcon(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_BYSTIAL),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.rmtg(e,c) local tp=e:GetHandlerPlayer() return c:GetOwner()==1-tp and Duel.IsPlayerCanRemove(tp,c) and c:GetReasonPlayer()==1-tp and (c:GetReason()&(REASON_RELEASE|REASON_RITUAL)==(REASON_RELEASE|REASON_RITUAL) or c:IsReason(REASON_FUSION|REASON_SYNCHRO|REASON_LINK)) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card attacks a DARK monster, destroy the attack target after damage calculation.
--カラクリ蜘蛛 --Karakuri Spider local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLED) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local bc=c:GetBattleTarget() if chk==0 then return c==Duel.GetAttacker() and bc and bc:IsAttribute(ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() if bc:IsRelateToBattle() then Duel.Destroy(bc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn (Quick Effect): You can send 1 "Elementsaber" monster from your hand to the GY, then target 1 face-up monster on the field; change it to face-down Defense Position. Once per turn, if this card is in the GY: You can declare 1 Attribute; this card in the GY becomes that Attribute until the end of this turn.
--エレメントセイバー・モーレフ --Elementsaber Molehu local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCost(s.setcost) e1:SetTarget(s.settg) e1:SetOperation(s.setop) c:RegisterEffect(e1) --att change local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1) e2:SetTarget(s.atttg) e2:SetOperation(s.attop) c:RegisterEffect(e2) end s.listed_series={SET_ELEMENTSABER} function s.costfilter(c) return c:IsSetCard(SET_ELEMENTSABER) and c:IsMonster() and c:IsAbleToGraveAsCost() end function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Group.CreateGroup() for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do fg:AddCard(pe:GetHandler()) end local loc=LOCATION_HAND if #fg>0 then loc=LOCATION_HAND|LOCATION_DECK end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,loc,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=Duel.SelectMatchingCard(tp,s.costfilter,tp,loc,0,1,1,nil):GetFirst() if tc:IsLocation(LOCATION_DECK) then local fc=nil if #fg==1 then fc=fg:GetFirst() else fc=fg:Select(tp,1,1,nil) end Duel.Hint(HINT_CARD,0,fc:GetCode()) fc:RegisterFlagEffect(61557074,RESETS_STANDARD_PHASE_END,0,0) end Duel.SendtoGrave(tc,REASON_COST) end function s.setfilter(c) return c:IsFaceup() and c:IsCanTurnSet() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.setfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end end function s.atttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local c=e:GetHandler() local att=c:AnnounceAnotherAttribute(tp) e:SetLabel(att) --Operation info needed to handle the interaction with "Necrovalley" Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,LOCATION_GRAVE) end function s.attop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end --Change Attribute local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetValue(e:GetLabel()) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end