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:
Return 1 face-up Synchro Monster you control to the Extra Deck to select and Special Summon a Tuner monster(s) from your Graveyard, whose total Levels equal the Level of that Synchro Monster. You cannot Synchro Summon the turn you activate this card.
--バラエティ・アウト --Variety Comes Out local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return not c:IsSynchroSummoned() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) 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:SetRange(LOCATION_MZONE) 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) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil) end function s.splimit(e,c,tp,sumtp,sumpos) return sumtp&SUMMON_TYPE_SYNCHRO==SUMMON_TYPE_SYNCHRO end function s.cfilter(c,e,tp,g,maxc) local tmax=maxc if c:GetSequence()<5 then tmax=tmax-1 end if tmax<=0 then return end return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToExtraAsCost() and g:CheckWithSumEqual(Card.GetLevel,c:GetLevel(),1,maxc) end function s.spfilter(c,e,tp) return c:IsType(TYPE_TUNER) and c:IsCanBeEffectTarget(e) 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 false end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local maxc=ft+1 if maxc>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then maxc=1 end if chk==0 then if e:GetLabel()==0 then return false end e:SetLabel(0) local spg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,spg,maxc) end e:SetLabel(0) local spg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,spg,maxc) local lv=cg:GetFirst():GetLevel() Duel.SendtoDeck(cg,nil,SEQ_DECKTOP,REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=spg:SelectWithSumEqual(tp,Card.GetLevel,lv,1,maxc) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,#sg,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) local ct=#g if ct==0 or (ct>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) or ct>Duel.GetLocationCount(tp,LOCATION_MZONE) then return end Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Destroy Spell/Trap Cards on the field equal to the number of other "tellarknight" cards you control.
--創星の因子 --Tellarknight Genesis local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_TELLARKNIGHT} function s.filter(c) return c:IsSpellTrap() end function s.cfilter(c) return c:IsSetCard(SET_TELLARKNIGHT) and c:IsFaceup() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_ONFIELD,0,c) if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,c) end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,ct,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_ONFIELD,0,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,c) Duel.Destroy(g,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Spell Card is activated that targets this face-down card (and no other cards) (Quick Effect): Change this card to face-up Defense Position, and if you do, negate the activation. If this card is attacked, change it to Attack Position at the end of the Damage Step.
--ビッグ・シールド・ガードナー --Big Shield Gardna local s,id=GetID() function s.initial_effect(c) --Change this card to face-up Defense Position, and if you do, negate the activation local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION+CATEGORY_NEGATE) e1:SetType(EFFECT_TYPE_QUICK_F) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_SET_AVAILABLE) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.negcon) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) --If this card is attacked, change it to Attack Position at the end End of the Damage Step local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetOperation(s.posop) c:RegisterEffect(e2) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) if not (re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)) then return false end local c=e:GetHandler() local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and #tg==1 and tg:GetFirst()==c and c:IsFacedown() end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,tp,POS_FACEUP_DEFENSE) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0) end function s.negop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.ChangePosition(c,POS_FACEUP_DEFENSE) then Duel.NegateActivation(ev) end end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c==Duel.GetAttackTarget() and c:IsDefensePos() and c:IsRelateToBattle() then Duel.ChangePosition(c,POS_FACEUP_ATTACK) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal Summoned, you can: Immediately after this effect resolves, Normal Summon 1 "Yosenju" monster from your hand, except "Yosenju Kama 1". If you control another "Yosenju" monster: You can target 1 face-up card your opponent controls; return it to the hand. This effect can only be used once while this card is face-up on the field. Once per turn, during the End Phase, if this card was Normal Summoned this turn: Return it to the hand.
--妖仙獣 鎌壱太刀 --Yosenju Kama 1 local s,id=GetID() function s.initial_effect(c) --summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) c:RegisterEffect(e1) --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET) e2:SetCountLimit(1) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) --return local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetOperation(s.regop) c:RegisterEffect(e3) end s.listed_series={SET_YOSENJU} s.listed_names={id} function s.filter(c) return c:IsSetCard(SET_YOSENJU) and not c:IsCode(id) and c:IsSummonable(true,nil) end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil) if #g>0 then Duel.Summon(tp,g:GetFirst(),true,nil) end end function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_YOSENJU) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end function s.thfilter(c) return c:IsFaceup() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetTarget(s.rettg) e1:SetOperation(s.retop) e1:SetReset(RESET_EVENT|RESETS_STANDARD&~(RESET_TEMP_REMOVE|RESET_TURN_SET)|RESET_PHASE|PHASE_END) c:RegisterEffect(e1) end function s.rettg(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.retop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This monster gets the following effect(s) while there is a monster(s) with the following Attribute(s) on the field: ● WATER: Control of this card cannot switch. ● WIND: If this card destroyed your opponent's monster by battle, it can attack once again in a row.
--エレメント・マジシャン --Element Magician local s,id=GetID() function s.initial_effect(c) --control local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_CHANGE_CONTROL) e1:SetCondition(s.ctlcon) c:RegisterEffect(e1) --chain attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(s.atcon) e2:SetOperation(s.atop) c:RegisterEffect(e2) end function s.filter(c,att) return c:IsFaceup() and c:IsAttribute(att) end function s.ctlcon(e) return Duel.IsExistingMatchingCard(s.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WATER) end function s.atcon(e,tp,eg,ep,ev,re,r,rp) return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():CanChainAttack() and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND) end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase: You can destroy 1 DARK monster in your hand or face-up field, and if you do, add 1 "Yubel", or 1 card that mentions it, from your Deck to your hand, except "Nightmare Pain". You can only use this effect of "Nightmare Pain" once per turn. While you control a "Yubel" monster, your opponent's monsters that can attack must attack "Yubel" monsters. Your opponent takes any battle damage you would have taken from battles involving your "Yubel" monsters.
--ナイトメア・ペイン --Nightmare Pain --Ashaki local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Search 1 "Yubel" or 1 card that mentions it local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Opponent's monsters must attack a "Yubel" monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_MUST_ATTACK) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_YUBEL),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_MUST_ATTACK_MONSTER) e3:SetValue(aux.TargetBoolFunction(Card.IsSetCard,SET_YUBEL)) c:RegisterEffect(e3) --Your opponent takes any battle damage you would have taken from battles involving your "Yubel" monsters instead local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE) e4:SetRange(LOCATION_SZONE) e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_YUBEL)) e4:SetValue(1) c:RegisterEffect(e4) end s.listed_names={CARD_YUBEL,id} s.listed_series={SET_YUBEL} function s.desfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) end function s.thfilter(c) return (c:IsCode(CARD_YUBEL) or c:ListsCode(CARD_YUBEL)) and c:IsAbleToHand() and not c:IsCode(id) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil) if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #sg>0 then Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Special Summon this card (from your hand or Deck) by sending 1 face-up Spellcaster monster and 1 face-up Level 4 or lower EARTH monster you control to the GY. You can only use each of the following effects of "Awakening of the Possessed - Nefariouser Archfiend" once per turn. ● When this card is Special Summoned by its effect: You can Special Summon 1 Level 4 or lower monster from your GY, but negate its effects. ● If this card is sent from the field to the GY: You can add 1 "Spiritual Earth Art" card or 1 "Possessed" Spell/Trap from your Deck to your hand.
--憑依覚醒-デーモン・リーパー --Awakening of the Possessed - Nefariouser Archfiend --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Special Sumon Procedure local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND|LOCATION_DECK) e1:SetValue(1) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special Summon from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) --Add to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_SPIRITUAL_EARTH_ART,SET_POSSESSED} function s.spfilter1(c) return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost() end function s.spfilter2(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsLevelBelow(4) and c:IsAbleToGraveAsCost() end function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg,tp) end function s.chk(c,sg,tp) return s.spfilter1(c,tp) and sg:IsExists(s.spfilter2,1,c) end function s.spcon(e,c) if c==nil then return true end local tp=e:GetHandlerPlayer() local g1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_MZONE,0,nil) local g2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_MZONE,0,nil) local g=g1:Clone() g:Merge(g2) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g1>0 and #g2>0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local g1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_MZONE,0,nil) local g2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_MZONE,0,nil) g1:Merge(g2) local g=aux.SelectUnselectGroup(g1,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.SendtoGrave(g,REASON_COST) if e:GetHandler():IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end function s.spfilter3(c,e,sp) return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,sp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter3,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.spfilter3,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.thfilter(c) return c:IsAbleToHand() and (c:IsSetCard(SET_SPIRITUAL_EARTH_ART) or (c:IsSetCard(SET_POSSESSED) and c:IsSpellTrap())) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is sent from the field to the Graveyard: You can Special Summon 1 Level 2 or lower "Gusto" monster from your Deck.
--ガスタ・ガルド --Gusto Gulldo local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GUSTO} function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.filter(c,e,tp) return c:IsLevelBelow(2) and c:IsSetCard(SET_GUSTO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
After 1 Counter Trap Card you control has been activated and has resolved, you can Tribute 1 DARK monster to Special Summon this card from your hand. If this card is Special Summoned in this way, destroy 1 card on the field.
--ダーク・ボルテニス --Dark Voltanis local s,id=GetID() function s.initial_effect(c) --counter local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_HAND) e1:SetOperation(s.chop1) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetRange(LOCATION_HAND) e2:SetOperation(s.chop2) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_CHAIN_END) e3:SetRange(LOCATION_HAND) e3:SetCondition(s.spcon) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) e1:SetLabelObject(e3) e2:SetLabelObject(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_DESTROY) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCondition(s.descon) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) end function s.chop1(e,tp,eg,ep,ev,re,r,rp) e:GetLabelObject():SetLabel(0) end function s.chop2(e,tp,eg,ep,ev,re,r,rp) if rp~=tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_COUNTER) then return end e:GetLabelObject():SetLabel(1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetLabel()==1 end function s.cfilter(c,ft,tp) return c:IsAttribute(ATTRIBUTE_DARK) and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup()) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,ft,tp) end local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,ft,tp) Duel.Release(g,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,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,1,tp,tp,false,false,POS_FACEUP) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 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 true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ Plant monsters This card cannot be targeted for attacks, but does not prevent your opponent from attacking you directly. Three times per turn, if you take battle or effect damage: You can gain that much LP, and if you do, Special Summon 1 "Sunvine" monster from your Extra Deck. Once per turn, when a monster this card points to is targeted for an attack: You can negate the attack, and if you do, move that monster you control to another of your Main Monster Zones.
--聖天樹の大精霊 --Sunavalon Dryanome --Scripted by Eerie Code, partially based on the anime script local s,id=GetID() function s.initial_effect(c) --link summon c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_PLANT),2) --attack target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_IGNORE_BATTLE_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetValue(1) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DAMAGE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(3) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Negate an attack and move that monster you control to another of your Main Monster Zones local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BE_BATTLE_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.mvcon) e3:SetOperation(s.mvop) c:RegisterEffect(e3) end s.listed_series={SET_SUNVINE} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and (r&REASON_BATTLE+REASON_EFFECT)~=0 end function s.spfilter(c,e,tp) return c:IsSetCard(SET_SUNVINE) 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.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,1,tp,ev) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.Recover(tp,ev,REASON_EFFECT)==ev and Duel.GetLocationCountFromEx(tp)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end function s.mvcon(e) local tp=e:GetHandler():GetControler() local lg=e:GetHandler():GetLinkedGroup() local d=Duel.GetAttackTarget() return d and lg:IsContains(d) and d:IsControler(tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end function s.mvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetAttackTarget() if tc and tc:IsRelateToBattle() and Duel.NegateAttack() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,nil) local nseq=math.log(s,2) Duel.MoveSequence(tc,nseq) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card attacks a Defense Position monster, inflict piercing battle damage.
--暗黒ドリケラトプス --Dark Driceratops local s,id=GetID() function s.initial_effect(c) --pierce local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_PIERCE) c:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Spell/Trap(s) is sent to the GY by a card effect: Set 1 Spell/Trap from your hand or GY, but it cannot be activated this turn. During your Main Phase: You can banish 3 Spells/Traps from your GY, including this card; Special Summon 1 "Diabell" monster from your hand or GY. You can only use each effect of "Like the Diabell" once per turn.
--ライク・ザ・ディアベル --Like the Diabell --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Set 1 Spell/Trap from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_LEAVE_GRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.setcon) e1:SetTarget(s.settg) e1:SetOperation(s.setop) c:RegisterEffect(e1) --Special Summon 1 "Diabell" monster from your hand or GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_DIABELL} function s.setconfilter(c) return c:IsSpellTrap() and c:IsReason(REASON_EFFECT) end function s.setcon(e,tp,eg,ep,ev,re,r,rp) return re and re:IsActivated() and eg:IsExists(s.setconfilter,1,nil) end function s.setfilter(c,ft) return c:IsSpellTrap() and c:IsSSetable() and (ft>0 or c:IsFieldSpell()) end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) if c:IsLocation(LOCATION_HAND) then ft=ft-1 end if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,c,ft) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,ft):GetFirst() if sc and Duel.SSet(tp,sc,tp,false)>0 then --It cannot be activated this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetReset(RESETS_STANDARD_PHASE_END) sc:RegisterEffect(e1) end end function s.spcostfilter(c) return c:IsSpellTrap() and c:IsAbleToRemoveAsCost() end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return s.spcostfilter(c) and Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,2,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,2,2,c) Duel.Remove(g+c,POS_FACEUP,REASON_COST) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_DIABELL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) 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 Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
3 Level 4 Spellcaster-Type monsters This card gains 200 ATK for each Spell Card in your Graveyard. Once per turn, during your End Phase: You can detach 1 Xyz Material from this card and send 1 card from your hand to the Graveyard; choose 1 Spell Card from your Deck, then Set it in your Spell & Trap Card Zone.
--アルケミック・マジシャン --Alchemic Magician local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure: 3 Level 4 Spellcaster monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),4,3) --This card gains 200 ATK for each Spell in your GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(function(e,c) return Duel.GetMatchingGroupCount(Card.IsSpell,c:GetControler(),LOCATION_GRAVE,0,nil)*200 end) c:RegisterEffect(e1) --Set 1 Spell from your Deck to your Spell & Trap Zone local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) e2:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.setcost)) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.setfilter(c) return c:IsSpell() and not c:IsFieldSpell() and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Beast-Type monster you control is destroyed by battle and sent to the Graveyard, you can remove from play 2 Beast-Type monsters in your Graveyard to Special Summon this card from your hand.
--森の狩人イエロー・バブーン --Yellow Baboon, Archer of the Forest local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.cfilter(c,tp) return c:IsLocation(LOCATION_GRAVE) and c:IsMonster() and c:IsRace(RACE_BEAST) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and (c:GetPreviousRaceOnField()&RACE_BEAST)~=0 end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.rfiletr(c) return c:IsRace(RACE_BEAST) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(s.rfiletr,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Xyz Monsters with the same Rank, except "Number" monsters (This card's original Rank is always treated as 1.) Cannot be destroyed by battle, and neither player takes any battle damage from attacks involving this card. At the end of the Damage Step, if this card battled an opponent's monster: You can take control of that opponent's monster until the end of the Battle Phase. If this face-up card on the field would be destroyed by a card effect, you can detach 1 material from this card instead.
--FNo.0 未来皇ホープ --Number F0: Utopic Future local s,id=GetID() function s.initial_effect(c) --xyz summon c:EnableReviveLimit() Xyz.AddProcedure(c,s.xyzfilter,nil,2,nil,nil,nil,nil,false,s.xyzcheck) --indes local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e3:SetValue(1) c:RegisterEffect(e3) --avoid damage local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_NO_BATTLE_DAMAGE) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e5:SetValue(1) c:RegisterEffect(e5) --control local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,0)) e6:SetCategory(CATEGORY_CONTROL) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetCode(EVENT_DAMAGE_STEP_END) e6:SetTarget(s.cttg) e6:SetOperation(s.ctop) c:RegisterEffect(e6) --destroy replace local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e7:SetCode(EFFECT_DESTROY_REPLACE) e7:SetRange(LOCATION_MZONE) e7:SetTarget(s.reptg) c:RegisterEffect(e7) end s.xyz_number=0 function s.xyzfilter(c,xyz,sumtype,tp) return c:IsType(TYPE_XYZ,xyz,sumtype,tp) and not c:IsSetCard(SET_NUMBER,xyz,sumtype,tp) end function s.xyzcheck(g,tp,xyz) local mg=g:Filter(function(c) return not c:IsHasEffect(EFFECT_EQUIP_SPELL_XYZ_MAT) end,nil) return mg:GetClassCount(Card.GetRank)==1 end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetHandler():GetBattleTarget() if chk==0 then return tc and tc:IsRelateToBattle() and tc:IsControlerCanBeChanged() end Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetHandler():GetBattleTarget() if tc:IsRelateToBattle() then Duel.GetControl(tc,tp,PHASE_BATTLE,1) end end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end if Duel.SelectEffectYesNo(tp,c,96) then c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) return true else return false end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can place 1 "Fire King Island" from your Deck face-up in your Field Zone. Once per turn, if a card in your Field Zone would be destroyed by card effect, you can destroy 1 FIRE monster in your hand or face-up field instead. Once per turn, if your opponent Special Summons a monster(s), you can: Immediately after this effect resolves, Xyz Summon 1 FIRE Xyz Monster using only "Fire King" monsters you control. You can only activate 1 "Fire King Sanctuary" per turn.
--炎王の聖域 --Fire King Sanctuary --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Destruction replacement local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetTarget(s.desreptg) e2:SetValue(s.desrepval) e2:SetOperation(s.desrepop) c:RegisterEffect(e2) --Xyz Summon using only "Fire King" monsters local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(function(e,tp,eg) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end) e3:SetTarget(s.xyztg) e3:SetOperation(s.xyzop) c:RegisterEffect(e3) end s.listed_names={57554544} --Fire King Island s.listed_series={SET_FIRE_KING} function s.plfilter(c,tp) return c:IsCode(57554544) and not c:IsForbidden() end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.plfilter,tp,LOCATION_DECK,0,nil,tp) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local tc=g:Select(tp,1,1,nil):GetFirst() if not tc then return end Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) end end function s.repfilter(c,tp) return c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and c:IsLocation(LOCATION_FZONE) end function s.desfilter(c,e) return c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED|STATUS_BATTLE_DESTROYED) end function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) end function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_HAND,0,nil) if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and g:IsExists(s.desfilter,1,nil,e) end if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local sg=g:FilterSelect(tp,s.desfilter,1,1,nil,e) e:SetLabelObject(sg:GetFirst()) Duel.HintSelection(sg,true) sg:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true) return true else return false end end function s.desrepval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.desrepop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(tc,REASON_EFFECT|REASON_REPLACE) end function s.xyzfilter(c,mg) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsXyzSummonable(nil,mg) end function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk) local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_FIRE_KING),tp,LOCATION_MZONE,0,nil) if chk==0 then return #mg>0 and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.xyzop(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_FIRE_KING),tp,LOCATION_MZONE,0,nil) if #mg==0 then return end local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() Duel.XyzSummon(tp,sc,nil,mg) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Special Summoned from the Deck. If you control no monsters, you can Normal Summon this card without Tributing. Cannot be destroyed by battle or card effects. You take no battle damage from attacks involving this card. At the end of the Battle Phase, if this card battled and your LP is less than 4000: Your LP becomes 4000. Once per turn, during your Standby Phase: Shuffle this card into the Deck.
--時械神サディオン --Sadion, the Timelord local s,id=GetID() function s.initial_effect(c) --cannot special summon local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetRange(LOCATION_DECK) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SUMMON_PROC) e2:SetCondition(s.ntcon) c:RegisterEffect(e2) --indes local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e3:SetValue(1) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e4) local e5=e3:Clone() e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) c:RegisterEffect(e5) --change lp local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,1)) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e6:SetCode(EVENT_PHASE|PHASE_BATTLE) e6:SetCountLimit(1) e6:SetRange(LOCATION_MZONE) e6:SetCondition(s.lpcon) e6:SetOperation(s.lpop) c:RegisterEffect(e6) --to deck local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,2)) e7:SetCategory(CATEGORY_TODECK) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e7:SetCode(EVENT_PHASE|PHASE_STANDBY) e7:SetCountLimit(1) e7:SetRange(LOCATION_MZONE) e7:SetCondition(s.rtdcon) e7:SetTarget(s.rtdtg) e7:SetOperation(s.rtdop) c:RegisterEffect(e7) end function s.ntcon(e,c,minc) if c==nil then return true end return minc==0 and c:GetLevel()>4 and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.lpcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 and Duel.GetLP(tp)<4000 end function s.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(tp,4000) end function s.rtdcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.rtdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) end function s.rtdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned, or at the start of the Damage Step, if a monster battles: You can target 1 Level 4 or lower FIRE Dragon monster in your GY; Special Summon it. You can only use this effect of "Tenpai Dragon Fadra" once per turn. Your FIRE Dragon monsters cannot be destroyed by battle. Once per turn, during the Battle Phase, you can (Quick Effect): Immediately after this effect resolves, Synchro Summon using this card you control.
--天盃龍ファドラ --Tenpai Dragon Fadra --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon 1 Level 4 or lower FIRE Dragon monster in your GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_START) e3:SetRange(LOCATION_MZONE) c:RegisterEffect(e3) --Your FIRE Dragon monsters cannot be destroyed by battle local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTarget(function(e,c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_DRAGON) end) e4:SetValue(1) c:RegisterEffect(e4) --Synchro Summon during the Battle Phase local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) e5:SetHintTiming(0,TIMING_BATTLE_START|TIMING_BATTLE_END) e5:SetCountLimit(1) e5:SetCondition(function() return Duel.IsBattlePhase() end) e5:SetTarget(s.synchtg) e5:SetOperation(s.synchop) c:RegisterEffect(e5) end function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function s.synchtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.synchop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SynchroSummon(tp,sg:GetFirst(),c) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ monsters with different names If this card is Link Summoned: You can discard 1 card, then target 1 Spell/Trap in your GY; Set it to your field, but it cannot be activated this turn, then, if this card was co-linked when this effect was activated, you can draw 1 card. You can only use this effect of "Knightmare Gryphon" once per turn. Special Summoned monsters on the field cannot activate their effects, unless they are linked.
--トロイメア・グリフォン --Knightmare Gryphon --Script by nekrozar local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,nil,2,99,s.lcheck) c:EnableReviveLimit() --Set local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(s.setcon) e1:SetCost(s.setcost) e1:SetTarget(s.settg) e1:SetOperation(s.setop) c:RegisterEffect(e1) --Cannot activate local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(1,1) e2:SetValue(s.aclimit) c:RegisterEffect(e2) end function s.lcheck(g,lc,sumtype,tp) return g:CheckDifferentProperty(Card.GetCode,lc,sumtype,tp) end function s.setcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLinkSummoned() end function s.setcost(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.setfilter(c) return c:IsSpellTrap() and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.setfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) if e:GetHandler():GetMutualLinkedGroupCount()>0 then e:SetLabel(1) else e:SetLabel(0) end local cat=0 if e:GetLabel()==1 then cat=cat+CATEGORY_DRAW end e:SetCategory(cat) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsSSetable() and Duel.SSet(tp,tc)>0 then --Cannot be activated this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetReset(RESET_EVENT|RESETS_CANNOT_ACT|RESET_PHASE|PHASE_END) tc:RegisterEffect(e1) if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end end function s.aclimit(e,re,tp) local tc=re:GetHandler() return tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsSpecialSummoned() and not tc:IsLinked() and re:IsMonsterEffect() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal or Special Summoned from the hand: You can add 1 "Polymerization" from your Deck to your hand. You can pay 500 LP; Fusion Summon 1 "Frightfur" Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Materials. You can only use 1 "Fluffal Owl" effect per turn, and only once that turn.
--ファーニマル・オウル --Fluffal Owl local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --spsummon local params={aux.FilterBoolFunction(Card.IsSetCard,SET_FRIGHTFUR)} local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCost(Cost.PayLP(500)) e3:SetTarget(Fusion.SummonEffTG(table.unpack(params))) e3:SetOperation(Fusion.SummonEffOP(table.unpack(params))) c:RegisterEffect(e3) end s.listed_series={SET_FRIGHTFUR} s.listed_names={CARD_POLYMERIZATION} function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND) end function s.thfilter(c) return c:IsCode(CARD_POLYMERIZATION) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp,chk) 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:
Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell Card resolves (max. 3). You can Tribute this card with 3 Spell Counters on it; Special Summon 1 "Archfiend" monster from your hand, Deck, or GY. You can banish this card from your GY, then target 1 card you control that you can place a Spell Counter on; place 1 Spell Counter on it.
--熟練の赤魔術士 --Skilled Red Magician local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_SPELL) c:SetCounterLimit(COUNTER_SPELL,3) --add counter local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetOperation(aux.chainreg) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetRange(LOCATION_MZONE) e2:SetOperation(s.acop) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) --counter local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCost(Cost.SelfBanish) e4:SetTarget(s.cttg) e4:SetOperation(s.ctop) c:RegisterEffect(e4) end s.counter_place_list={COUNTER_SPELL} s.listed_series={SET_ARCHFIEND} 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.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetCounter(COUNTER_SPELL)==3 and e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function s.filter(c,e,tp) return c:IsSetCard(SET_ARCHFIEND) 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.filter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.ctfilter(c) return c:IsFaceup() and c:IsCanAddCounter(COUNTER_SPELL,1) end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.ctfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,COUNTER_SPELL) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then tc:AddCounter(COUNTER_SPELL,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card's name becomes "Magical Citadel of Endymion" while in the Spell & Trap Zone. Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell resolves. Once per turn, after damage calculation, if your Spellcaster monster is destroyed by battle: You can remove 6 Spell Counters from your field; Special Summon 1 Level 7 or higher Spellcaster monster from your hand or Deck. You can only activate 1 "Endymion's Lab" per turn.
--魔法都市の実験施設 --Endymion's Lab --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_SPELL) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e1) --Change name local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_CHANGE_CODE) e2:SetRange(LOCATION_SZONE) e2:SetValue(39910367) c:RegisterEffect(e2) --Add counter local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_CHAIN_SOLVING) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_SZONE) e3:SetOperation(s.ctop) c:RegisterEffect(e3) --Special Summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_HANDES) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLE_DESTROYED) e4:SetRange(LOCATION_SZONE) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCountLimit(1) e4:SetCondition(s.spcon) e4:SetCost(s.spcost) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) end s.counter_place_list={COUNTER_SPELL} s.listed_names={39910367} function s.ctop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and re:GetHandler()~=c then c:AddCounter(COUNTER_SPELL,1) end end function s.cfilter(c,tp) return c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp) and c:GetPreviousRaceOnField()&RACE_SPELLCASTER==RACE_SPELLCASTER end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,COUNTER_SPELL,6,REASON_COST) end Duel.RemoveCounter(tp,1,0,COUNTER_SPELL,6,REASON_COST) end function s.spfilter(c,e,tp) return c:IsLevelAbove(7) and c:IsRace(RACE_SPELLCASTER) 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 not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|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 you control an "Evil Eye" monster and this card is in your hand or GY (Quick Effect): You can Special Summon this card, but banish it when it leaves the field. During your opponent's turn, you can (Quick Effect): Immediately after this effect resolves, Link Summon 1 "Evil Eye" Link Monster using monsters you control as material. When you do, you can also use "Evil Eye" Equip Spells you control as "Evil Eye" monsters. You can only use each effect of "Basiltrice, Familiar of the Evil Eye" once per turn.
--呪眼の眷属 バジリコック --Basiltrice, Familiar of the Evil Eye --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Link Summon 1 "Evil Eye" monster during opponent's turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(_,tp) return Duel.IsTurnPlayer(1-tp) end) e2:SetTarget(s.lnktg) e2:SetOperation(s.lnkop) c:RegisterEffect(e2) end s.listed_series={SET_EVIL_EYE} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_EVIL_EYE),tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it if it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end function s.eqfilter(c) return c:IsSetCard(SET_EVIL_EYE) and c:IsEquipSpell() end function s.lnkfilter(c) return c:IsSetCard(SET_EVIL_EYE) and c:IsLinkSummonable() end function s.lnktg(e,tp,eg,ep,ev,re,r,rp,chk) local e1,e2 = s.tempregister(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local res=Duel.IsExistingMatchingCard(s.lnkfilter,tp,LOCATION_EXTRA,0,1,nil) e1:Reset() e2:Reset() return res end e1:Reset() e2:Reset() Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.lnkop(e,tp,eg,ep,ev,re,r,rp,chk) local e1,e2 = s.tempregister(e,tp,eg,ep,ev,re,r,chk) local g=Duel.GetMatchingGroup(s.lnkfilter,tp,LOCATION_EXTRA,0,nil) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() if not sc then e1:Reset() e2:Reset() return end Duel.LinkSummon(tp,sc) --Manually reset e1 and e2 when the monster would be Link Summoned local e3=Effect.CreateEffect(e:GetHandler()) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EVENT_SPSUMMON) e3:SetOperation(s.resetop) e3:SetLabelObject({e1,e2}) Duel.RegisterEffect(e3,tp) end end function s.resetop(e,tp,eg,ep,ev,re,r,rp) local e1,e2=table.unpack(e:GetLabelObject()) e1:Reset() e2:Reset() e:Reset() end function s.tempregister(e,tp,eg,ep,ev,re,r,rp,chk) --Can treat "Evil Eye" Equip cards as Link Material if using this effect local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_EXTRA_MATERIAL) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_SET_AVAILABLE) e1:SetTargetRange(1,0) e1:SetOperation(aux.TRUE) e1:SetValue(s.extraval) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_ADD_TYPE) e2:SetTargetRange(LOCATION_SZONE,0) e2:SetCondition(s.addtypecon) e2:SetTarget(aux.TargetBoolFunction(s.eqfilter)) e2:SetValue(TYPE_MONSTER) Duel.RegisterEffect(e2,tp) return e1,e2 end function s.matfilter(c) return c:IsFaceup() and c:IsSetCard(SET_EVIL_EYE) and c:IsSpell() and c:IsType(TYPE_EQUIP) end function s.extraval(chk,summon_type,e,...) if chk==0 then local tp,sc=... if summon_type~=SUMMON_TYPE_LINK or not (sc and sc:IsSetCard(SET_EVIL_EYE)) then return Group.CreateGroup() else Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) return Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_ONFIELD,0,nil) end elseif chk==2 then Duel.ResetFlagEffect(e:GetHandlerPlayer(),id) end end function s.addtypecon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 Zombie monster on the field; until the end of this turn, it gains 1000 ATK or loses 1000 ATK. During your Main Phase, if this card is in your GY: You can shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card, but banish it when it leaves the field. You can only use this effect of "Zombie Power Struggle" once per turn.
--アンデット・ストラグル --Zombie Power Struggle --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Targeted zombie monster either gains or loses 1000 ATK local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Set itself from GY local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TODECK) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc,race) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local atk=1000 if Duel.SelectYesNo(tp,aux.Stringid(id,0)) then atk=atk*-1 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(atk) tc:RegisterEffect(e1) end end --Check for a zombie monster to return to deck function s.setfilter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck() end --Activation legality function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsSSetable() and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end --Shuffle 1 of your banished zombies, and if you, set this card function s.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_REMOVED,0,1,1,nil) if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsSSetable() then Duel.SSet(tp,c) --Banish it if it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1) 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) while you control no monsters. Cannot attack if you control another monster.
--フォトン・スラッシャー --Photon Thrasher 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) --cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCondition(s.atcon) c:RegisterEffect(e2) end function s.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.atcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>1 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
The original ATK of all face-up monsters you control becomes 0, until the End Phase. Each time a monster that had its original ATK reduced to 0 by this effect is destroyed by battle and sent to the Graveyard, draw 1 card.
--アルケミー・サイクル --Alchemy Cycle local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:GetBaseAttack()~=0 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) local c=e:GetHandler() local fid=c:GetFieldID() for tc in g:Iter() do if not tc:IsImmuneToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(0) tc:RegisterEffect(e1) tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD_EXC_GRAVE|RESET_PHASE|PHASE_END,0,1,fid) end end local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCondition(s.drcon) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetLabel(fid) Duel.RegisterEffect(e2,tp) end function s.drfilter(c,fid) return c:GetFlagEffectLabel(id)==fid end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.drfilter,1,nil,e:GetLabel()) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(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:
Target 1 face-up Attack Position Effect Monster on each side of the field; if both monsters are still face-up on the field, negate their effects, then if both their effects were negated by this effect, as long as those monsters are in face-up Attack Position, they cannot be destroyed by battle, are unaffected by other card effects, also they cannot attack or change their battle positions.
--実力伯仲 --Stand-Off 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:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT) 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(s.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK) Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc1,tc2=Duel.GetFirstTarget() if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and tc2:IsRelateToEffect(e) and tc2:IsFaceup() then local a=0 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) if not tc1:IsDisabled() then tc1:RegisterEffect(e1) tc1:RegisterEffect(e2) a=a+1 end if not tc2:IsDisabled() then local e3=e1:Clone() local e4=e2:Clone() tc2:RegisterEffect(e3) tc2:RegisterEffect(e4) a=a+1 end if tc1:IsDefensePos() or tc2:IsDefensePos() or a~=2 then return end Duel.BreakEffect() s.reg(c,tc1,tc2) s.reg(c,tc2,tc1) end end function s.reg(c,tc1,tc2) tc1:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHANGE_POS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetOperation(s.posop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc1:RegisterEffect(e1) --Cannot be destroyed by battle local e2=Effect.CreateEffect(c) e2:SetDescription(3000) e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetCondition(s.effcon) e2:SetValue(1) e2:SetReset(RESET_EVENT|RESETS_STANDARD) e2:SetLabelObject(tc2) tc1:RegisterEffect(e2) --Cannot change their battle positions local e3=e2:Clone() e3:SetDescription(3313) e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION) tc1:RegisterEffect(e3) --Cannot attack local e4=e2:Clone() e4:SetDescription(3206) e4:SetCode(EFFECT_CANNOT_ATTACK) tc1:RegisterEffect(e4) --Unaffected by other card effects local e5=e2:Clone() e5:SetDescription(3100) e5:SetCode(EFFECT_IMMUNE_EFFECT) e5:SetValue(s.efilter) tc1:RegisterEffect(e5) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:GetFlagEffect(id)~=0 and not c:IsPosition(POS_FACEUP_ATTACK) then c:ResetFlagEffect(id) end end function s.effcon(e) return e:GetHandler():GetFlagEffect(id)~=0 and e:GetLabelObject():GetFlagEffect(id)~=0 end function s.efilter(e,te) return te:GetOwner()~=e:GetOwner() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with "Resurrection of Chakra".
--チャクラ --Chakra local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() end s.listed_names={39399168}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can only be activated during your Main Phase when "People Running About", "Oppressed People", and "United Resistance" are face-up on your side of the field. Send all cards in your opponent's hand to the Graveyard and destroy all cards your opponent controls on the field.
--大革命 --Huge Revolution local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={12143771,58538870,85936485} --"People Running About", "Oppressed People", "United Resistance" function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and Duel.IsMainPhase() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,12143771),tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,58538870),tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,85936485),tp,LOCATION_ONFIELD,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local desg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) if chk==0 then return #desg>0 or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil) end local hg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,hg,#hg,tp,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,desg,#desg,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local hg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil) if #hg>0 then Duel.SendtoGrave(hg,REASON_EFFECT) end local desg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) if #desg>0 then Duel.Destroy(desg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters When this card declares an attack while equipped: You can target 1 face-up card on the field; destroy it. During your Main Phase, except the turn this card was sent to the GY: You can target 1 Warrior monster you control; Special Summon this card from your GY as a Tuner, and if you do, equip that monster you control to this card as an Equip Spell that gives it 500 ATK. You can only use this effect of "Infernoble Knight Captain Oliver" once per turn.
--焔聖騎士将-オリヴィエ --Infernoble Knight Captain Oliver local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --Destroy 1 face-up card on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(function(e) return e:GetHandler():HasEquipCard() end) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Special Summon this card as a Tuner local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(aux.exccon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,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 function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_WARRIOR) end c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_WARRIOR),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_WARRIOR),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,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 c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER) if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then --Treated as a Tuner local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) if Duel.SpecialSummonComplete()==0 then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsControler(tp) then if not c:EquipByEffectAndLimitRegister(e,tp,tc,nil,true) then return end --The equipped monster gains 500 ATK local e2=Effect.CreateEffect(tc) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(500) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) --Equip limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_EQUIP_LIMIT) e3:SetValue(function(e,_c) return _c==c end) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While this card is face-up on the field, all effects of Spell, Trap, and Monster Cards that target a card(s) in the Graveyard or that activate in the Graveyard are negated.
--エンド・オブ・アヌビス --The End of Anubis local s,id=GetID() function s.initial_effect(c) --negate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetCondition(s.condition) e1:SetOperation(s.operation) c:RegisterEffect(e1) aux.DoubleSnareValidity(c,LOCATION_MZONE) end function s.gfilter(c) return c:IsLocation(LOCATION_GRAVE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) if loc==LOCATION_GRAVE then return true end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(s.gfilter,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can activate 1 of these effects. ● Banish 2 Zombie monsters from your GY; draw 1 card. ● Target 1 of your banished Zombie monsters; place that target on the top of your Deck.
--酒呑童子 --Shutendoji local s,id=GetID() function s.initial_effect(c) --Draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e1:SetCost(s.drcost) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) --todeck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCategory(CATEGORY_TODECK) e2:SetRange(LOCATION_MZONE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end function s.cfilter(c) return c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,2,nil) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,2,2,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Main Phase (Quick Effect): You can target 1 Insect monster in your GY and 1 monster in your opponent's GY; Special Summon this card from your hand, and if you do, place the targeted monsters on the bottoms of the Decks. If this card is Normal or Special Summoned: You can add 1 "Beetrooper" Spell/Trap from your Deck to your hand. You can only use each effect of "Beetrooper Sting Lancer" once per turn.
--騎甲虫スティンギー・ランス --Beetrooper Sting Lancer 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+CATEGORY_TODECK) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCountLimit(1,id) e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Add 1 "Beetrooper" Spell/Trap from Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) 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_series={SET_BEETROOPER} function s.insectfilter(c,tp) return c:IsRace(RACE_INSECT) and c:IsControler(tp) end function s.tdfilter(c,e) return c:IsMonster() and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e) end function s.rescon(sg,e,tp,mg) return sg:IsExists(s.insectfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chkc then return false end local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and #g>=2 and g:IsExists(Card.IsControler,1,nil,1-tp) and g:IsExists(s.insectfilter,1,nil,tp) end local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TODECK) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,#sg,PLAYER_ALL,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetTargetCards(e) if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and #g>0 then local tc=g:Filter(Card.IsControler,nil,tp):GetFirst() if tc and not tc:IsRace(RACE_INSECT) then g:RemoveCard(tc) if #g==0 then return end end Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end function s.thfilter(c) return c:IsSetCard(SET_BEETROOPER) and c:IsSpellTrap() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control 2 or more Dinosaur monsters and your LP is lower than your opponent's: Destroy as many monsters on the field as possible, and if you do, take 1000 damage for each monster destroyed, then inflict damage to your opponent, equal to the damage you took. Until the end of the next turn after this card is activated, neither player can Normal or Special Summon.
--ジュラシック・インパクト --Jurassic Impact local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_MZONE,0,2,nil,RACE_DINOSAUR) and Duel.GetLP(tp)<Duel.GetLP(1-tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0 end local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,#g*1000) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) local ct=Duel.Destroy(g,REASON_EFFECT) if ct>0 then local val=Duel.Damage(tp,ct*1000,REASON_EFFECT) if val>0 and Duel.GetLP(tp)>0 then Duel.BreakEffect() Duel.Damage(1-tp,val,REASON_EFFECT) end end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetTargetRange(1,1) 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) local e3=Effect.CreateEffect(e:GetHandler()) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e3:SetDescription(aux.Stringid(id,1)) e3:SetReset(RESET_PHASE|PHASE_END,2) e3:SetTargetRange(1,1) Duel.RegisterEffect(e3,tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate this card by targeting 1 Effect Monster on the field. The first two times that monster would be destroyed by battle each turn, it is not destroyed. When it is destroyed by battle, the player that destroyed it gains 2000 LP. If the turn player's opponent takes battle or effect damage: Activate this effect; that opponent can apply the following effect. ● Special Summon 1 Level 4 or lower monster from your hand or Deck, but lose 2000 LP.
--Battle Royal Mode-Joining --Battle Royal Mode - Joining --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate by targeting 1 monster aux.AddPersistentProcedure(c,PLAYER_ALL,aux.FaceupFilter(Card.IsType,TYPE_EFFECT)) --The first two times that monster would be destroyed by battle each turn, it is not destroyed local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetRange(LOCATION_SZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetCountLimit(2) e1:SetTarget(aux.PersistentTargetFilter) e1:SetValue(function(_,_,r) return r&REASON_BATTLE==REASON_BATTLE end) c:RegisterEffect(e1) --When it is destroyed by battle, the player that destroyed it gains 2000 LP local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetOperation(s.lpop) c:RegisterEffect(e2) --Special Summon 1 Level 4 or lower monster from your hand or Deck, but lose 2000 LP local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_DAMAGE) e3:SetRange(LOCATION_SZONE) e3:SetCondition(function(_,_,_,ep) return Duel.IsTurnPlayer(1-ep) end) e3:SetOperation(s.spop) c:RegisterEffect(e3) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetHandler():GetFirstCardTarget() if tc and eg:IsContains(tc) and tc:IsReason(REASON_BATTLE) then Duel.Recover(tc:GetReasonPlayer(),2000,REASON_EFFECT) end end function s.spfilter(c,e,tp) return c:IsLevelBelow(4) 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 not (c:IsRelateToEffect(e) and Duel.GetLocationCount(ep,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,ep,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,ep) and Duel.SelectYesNo(ep,aux.Stringid(id,1))) then return end Duel.Hint(HINT_SELECTMSG,ep,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(ep,s.spfilter,ep,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,ep) if #sg>0 and Duel.SpecialSummon(sg,0,ep,ep,false,false,POS_FACEUP)>0 then Duel.SetLP(ep,Duel.GetLP(ep)-2000) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
All WATER monsters you control gain 300 ATK/DEF. All "Aquaactress" monsters you control gain 300 ATK/DEF. If this card is sent from the field to the GY: You can target 1 Aqua monster in your GY; Special Summon it, also you cannot Special Summon monsters for the rest of this turn, except Aqua monsters.
--水舞台装置 --Aquarium Set 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 & def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER)) e2:SetValue(300) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_AQUAACTRESS)) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e5) --spsummon local e6=Effect.CreateEffect(c) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetCode(EVENT_TO_GRAVE) e6:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e6:SetCondition(s.spcon) e6:SetTarget(s.sptg) e6:SetOperation(s.spop) c:RegisterEffect(e6) end s.listed_series={SET_AQUAACTRESS} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.spfilter(c,e,tp) return c:IsRace(RACE_AQUA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,1)) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:GetRace()~=RACE_AQUA end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Pay 1000 LP; Special Summon 1 Ritual Monster from your hand, but it cannot attack, also destroy it during the End Phase. You can only activate 1 "Ritual Foregone" per turn.
--限定解除 --Ritual Foregone local s,id=GetID() function s.initial_effect(c) --Special summon 1 ritual monster from hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(Cost.PayLP(1000)) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsRitualMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,true) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,true,POS_FACEUP) --Cannot attack local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1,true) tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) --Destroy it during end phase 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:SetLabelObject(tc) e2:SetCondition(s.descon) e2:SetOperation(s.desop) Duel.RegisterEffect(e2,tp) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:GetFlagEffect(id)~=0 then return true else e:Reset() return false end end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.Destroy(tc,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand), while you control "Toon World". Cannot attack the turn it is Special Summoned. You must pay 500 LP to declare an attack with this monster. If "Toon World" on the field is destroyed, destroy this card. Can attack your opponent directly, unless they control a Toon monster, in which case this card must target a Toon monster for its attacks.
--トゥーン・マーメイド --Toon Mermaid local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --special summon rule local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(s.sdescon) e3:SetOperation(s.sdesop) c:RegisterEffect(e3) --direct attack local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_DIRECT_ATTACK) e4:SetCondition(s.dircon) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e5:SetCondition(s.atcon) e5:SetValue(s.atlimit) c:RegisterEffect(e5) local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e6:SetCondition(s.atcon) c:RegisterEffect(e6) --cannot attack local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e7:SetCode(EVENT_SPSUMMON_SUCCESS) e7:SetOperation(s.atklimit) c:RegisterEffect(e7) --attack cost local e8=Effect.CreateEffect(c) e8:SetType(EFFECT_TYPE_SINGLE) e8:SetCode(EFFECT_ATTACK_COST) e8:SetCost(s.atcost) e8:SetOperation(s.atop) c:RegisterEffect(e8) end s.listed_names={15259703} function s.cfilter(c) return c:IsFaceup() and c:IsCode(15259703) end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end function s.sfilter(c) return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousCodeOnField()==15259703 and c:IsPreviousLocation(LOCATION_ONFIELD) end function s.sdescon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.sfilter,1,nil) end function s.sdesop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end function s.atkfilter(c) return c:IsFaceup() and c:IsType(TYPE_TOON) end function s.dircon(e) return not Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.atcon(e) return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.atlimit(e,c) return not c:IsType(TYPE_TOON) or c:IsFacedown() end function s.atklimit(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.atcost(e,c,tp) return Duel.CheckLPCost(tp,500) end function s.atop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsAttackCostPaid()~=2 and e:GetHandler():IsLocation(LOCATION_MZONE) then Duel.PayLPCost(tp,500) Duel.AttackCostPaid() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can add 1 "Jinzo" or 1 Spell/Trap that specifically lists that card in its text, from your Deck to your hand. When another monster you control is attacked by an opponent's monster, before damage calculation: You can destroy both the attacking monster and this card. You can only use each effect of "Psychic Bounder" once per turn.
--魔鏡導士サイコ・バウンダー --Psychic Bounder local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_CONFIRM) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_names={CARD_JINZO} function s.thfilter(c) return ((c:ListsCode(CARD_JINZO) and c:IsSpellTrap()) or c:IsCode(CARD_JINZO)) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local ac=Duel.GetAttacker() local at=Duel.GetAttackTarget() if chk==0 then return not e:GetHandler():IsRelateToBattle() and ac:IsControler(1-tp) and at and at:IsControler(tp) end local g=Group.FromCards(ac,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetAttacker() if tg:IsRelateToBattle() and not tg:IsStatus(STATUS_ATTACK_CANCELED) then local g=Group.FromCards(tg,e:GetHandler()) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] At the start of the Damage Step, if a monster you control battles an opponent's face-up monster: You can discard 1 card; the opponent's battling monster's ATK and DEF become half its current ATK and DEF (even if this card leaves the field). ---------------------------------------- [ Monster Effect ] If this card in its owner's Monster Zone is destroyed by your opponent's attack or card effect: You can add 1 Warrior or Spellcaster-Type monster with 2000 or less ATK from your Deck to your hand, except "Dragodies, the Empowered Warrior", during the End Phase of this turn.
--魔装戦士 ドラゴディウス --Dragodies, the Empowered Warrior local s,id=GetID() function s.initial_effect(c) --Pendulum Summon Pendulum.AddProcedure(c) --Halve ATK/DEF local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) e1:SetRange(LOCATION_PZONE) e1:SetCondition(s.atkcon) e1:SetCost(s.atkcost) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Search 1 Warrior or Spellcaster with 2000 or less ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) e2:SetCondition(s.regcon) e2:SetTarget(s.regtg) e2:SetOperation(s.regop) c:RegisterEffect(e2) end s.listed_names={id} function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local tc,bc=Duel.GetBattleMonster(tp) if not (tc and bc and bc:IsFaceup()) then return false end e:SetLabelObject(bc) return true end function s.atkcost(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_DISCARD+REASON_COST,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetLabelObject() if bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsControler(1-tp) then --Halve ATK/DEF local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(bc:GetAttack()/2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) bc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE_FINAL) e2:SetValue(bc:GetDefense()/2) bc:RegisterEffect(e2) end end function s.regcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp==1-tp and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))) end function s.regtg(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) end function s.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetCondition(s.thcon) e1:SetOperation(s.thop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.thfilter(c) return c:IsAttackBelow(2000) and c:IsRace(RACE_WARRIOR|RACE_SPELLCASTER) and not c:IsCode(id) and c:IsAbleToHand() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) 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:
Offer 1 of your monsters on the field as a Tribute (excluding this monster) during each of your Standby Phases. If you cannot, this card is destroyed. Monsters used for a Tribute Summon or that are offered as Tributes due to other cards' effects are excluded.
--味方殺しの女騎士 --The Unfriendly Amazon 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_STANDBY) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.costcon) e1:SetOperation(s.costop) c:RegisterEffect(e1) end function s.costcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.costop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.CheckReleaseGroup(tp,nil,1,c) then local g=Duel.SelectReleaseGroup(tp,nil,1,1,c) Duel.Release(g,REASON_COST) else Duel.Destroy(c,REASON_COST) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] When a monster declares an attack: You can discard 1 card; Special Summon this card to your opponent's field. You can only use this effect of "Abyss Actor - Liberty Dramatist" once per turn. ---------------------------------------- [ Monster Effect ] If this card is Special Summoned from the Pendulum Zone: The owner of this card reveals 3 "Abyss Script" Spells from their Deck, their opponent randomly picks 1 for this card's owner to Set on their field (but this effect destroys it during the End Phase), also shuffle the rest into the Deck. If this card is destroyed: You can shuffle 1 "Abyss Script" Spell from your GY into the Deck. You can only use each effect of "Abyss Actor - Liberty Dramatist" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--魔界劇団-リバティ・ドラマチスト --Abyss Actor - Liberty Dramatist --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) --Special Summon this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Reveal 3 "Abyss Script" Spells local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():IsSummonLocation(LOCATION_PZONE) end) e2:SetOperation(s.revop) c:RegisterEffect(e2) --Shuffle 1 "Abyss Script" Spell to the Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,2}) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end s.listed_series={SET_ABYSS_SCRIPT} function s.spcost(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.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and c:IsCanBeSpecialSummoned(e,1,tp,false,false,POS_FACEUP,1-tp) 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,1,tp,1-tp,false,false,POS_FACEUP) end end function s.revfilter(c) return c:IsSetCard(SET_ABYSS_SCRIPT) and c:IsSpell() and c:IsSSetable() and not c:IsPublic() end function s.revop(e,tp,eg,ep,ev,re,r,rp) local owner=e:GetHandler():GetOwner() Duel.Hint(HINT_SELECTMSG,owner,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(owner,s.revfilter,owner,LOCATION_DECK,0,3,3,nil) if #g~=3 then return end Duel.ConfirmCards(1-owner,g) Duel.ShuffleDeck(owner) local tc=g:RandomSelect(1-owner,1):GetFirst() if tc and Duel.SSet(owner,tc,owner,false)>0 then aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,0) end end function s.tdfilter(c) return c:IsSetCard(SET_ABYSS_SCRIPT) and c:IsSpell() and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.HintSelection(g,true) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase, your opponent cannot activate the effects of monsters in the same column as one of your "S-Force" monsters. If your opponent Normal or Special Summons a monster(s) while you control an "S-Force" monster (except during the Damage Step): You can Special Summon this card from your hand. You can only use this effect of "S-Force Dog Tag" once per turn.
--S-Force ドッグ・タッグ --S-Force Dog Tag --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Monsters in the same column as your "S-Force" monsters cannot activate their effects during your Main Phase local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_TRIGGER) e3:SetCondition(s.atcon) e3:SetValue(s.atlimit) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetTarget(aux.SForceTarget) c:RegisterEffect(e3) end s.listed_series={SET_S_FORCE} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_S_FORCE),tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.atcon(e) return Duel.IsTurnPlayer(e:GetHandlerPlayer()) and Duel.IsMainPhase() end function s.atlimit(e,c) return not e:GetHandler():GetColumnGroup():IsContains(c) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send 1 face-up "Umi" you control to the Graveyard to target up to 2 cards your opponent controls; send those targets to the Graveyard.
--コダロス --Codarus local s,id=GetID() function s.initial_effect(c) --send to grave local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={CARD_UMI} function s.cfilter(c) return c:IsFaceup() and c:IsCode(CARD_UMI) and c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToGrave() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,2,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) Duel.SendtoGrave(g,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Place 1 Resonance Counter on 1 card in your Pendulum Zone that you can place a Resonance Counter on, then apply 1 of these effects. ● Gain 500 LP, then you can add 1 of your banished "Vaalmonica" cards to your hand, except "Vaalmonica Disarmonia". ● Take 500 damage, then you can add 1 "Vaalmonica" card from your GY to your hand, except "Vaalmonica Disarmonia". You can only activate 1 "Vaalmonica Disarmonia" per turn.
--ヴァルモニカ・ディサルモニア --Vaalmonica Disarmonia --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COUNTER+CATEGORY_RECOVER+CATEGORY_DAMAGE+CATEGORY_TOHAND) 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_VAALMONICA} s.listed_names={id} s.counter_place_list={COUNTER_RESONANCE} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_PZONE,0,1,nil,COUNTER_RESONANCE,1) end Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,COUNTER_RESONANCE) Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) end function s.thfilter(c) return c:IsSetCard(SET_VAALMONICA) and not c:IsCode(id) and c:IsFaceup() and c:IsAbleToHand() end function s.activate(e,tp,eg,ep,ev,re,r,rp,angello_or_dimonno) --Additional parameter used by "Angello Vaalmonica" and "Dimonno Vaalmonica" local op=nil if angello_or_dimonno then op=angello_or_dimonno else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER) local tc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_PZONE,0,1,1,nil,COUNTER_RESONANCE,1):GetFirst() if not (tc and tc:AddCounter(COUNTER_RESONANCE,1)) then return end Duel.RaiseEvent(tc,EVENT_CUSTOM+39210885,e,0,tp,tp,1) op=Duel.SelectEffect(tp, {true,aux.Stringid(id,1)}, {true,aux.Stringid(id,2)}) Duel.BreakEffect() end if op==1 then --Gain 500 LP, then you can add 1 of your banished "Vaalmonica" cards to your hand local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_REMOVED,0,nil) if Duel.Recover(tp,500,REASON_EFFECT)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end elseif op==2 then --Take 500 damage, then you can add 1 "Vaalmonica" card from your GY to your hand local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_GRAVE,0,nil) if Duel.Damage(tp,500,REASON_EFFECT)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, when this card is targeted for an attack by an opponent's monster: You can move this card you control to another of your Main Monster Zones, then, Special Summon 1 "Squid Ink Token" (Aqua/WATER/Level 2/ATK ?/DEF 0). This Token's ATK becomes that opponent's monster's ATK. While this card is in your leftmost or rightmost Main Monster Zone, your opponent's monsters with ATK less than or equal to this card's DEF cannot target it for attacks.
--隅烏賊 --Squirt Squid --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --token local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetTarget(s.tktg) e1:SetCountLimit(1) e1:SetOperation(s.tkop) c:RegisterEffect(e1) --cannot be battle target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e2:SetCondition(s.tgcon) e2:SetValue(s.tgval) c:RegisterEffect(e2) end s.listed_names={65500516} function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk) local at=Duel.GetAttacker() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,at:GetAttack(),0,2,RACE_AQUA,ATTRIBUTE_WATER) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) end function s.tkop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local at=Duel.GetAttacker() if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local seq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0),2) Duel.MoveSequence(c,seq) if c:GetSequence()==seq and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,at:GetAttack(),0,2,RACE_AQUA,ATTRIBUTE_WATER) then Duel.BreakEffect() local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetValue(at:GetAttack()) e1:SetReset(RESET_EVENT|RESETS_STANDARD) token:RegisterEffect(e1) Duel.SpecialSummonComplete() end end function s.tgval(e,c) return not c:IsImmuneToEffect(e) and c:IsAttackBelow(e:GetHandler():GetDefense()) end function s.tgcon(e) local seq=e:GetHandler():GetSequence() return seq==0 or seq==4 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be used as Synchro Material, except for the Synchro Summon of a "Scrap" monster. At the end of the Battle Phase, if this face-up Defense Position card is targeted for an attack: Destroy this card. If this card is destroyed by the effect of a "Scrap" card and sent to the GY: You can target 1 "Scrap" monster in your GY, except "Scrap Soldier"; add that target to your hand.
--スクラップ・ソルジャー --Scrap Soldier local s,id=GetID() function s.initial_effect(c) --Register flag if this card is targeted for an attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetOperation(s.regop) c:RegisterEffect(e1) --Destroy this card at end of Battle Phase if this card was attacked 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:SetCode(EVENT_PHASE|PHASE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) --Add 1 "Scrap" monster from your GY to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) --Cannot be used as Synchro Material for non-"Scrap" Synchro Monsters local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetValue(s.synlimit) c:RegisterEffect(e2) end s.listed_series={SET_SCRAP} s.listed_names={id} function s.regop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsDefensePos() and e:GetHandler():IsFaceup() then e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE,0,1) end end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(id)~=0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) if not re then return false end local c=e:GetHandler() return c:IsReason(REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE) and re:GetHandler():IsSetCard(SET_SCRAP) end function s.thfilter(c) return c:IsSetCard(SET_SCRAP) and c:IsMonster() 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) Duel.ConfirmCards(1-tp,tc) end end function s.synlimit(e,c) if not c then return false end return not c:IsSetCard(SET_SCRAP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Set this card from your hand to your Spell & Trap Zone as a Spell. You can only use each of the following effects of "Toy Soldier" once per turn. If this Set card in the Spell & Trap Zone is sent to the GY: You can Special Summon this card. If this card is Normal or Special Summoned: You can add 1 "Toy Box" from your Deck to your hand, or, if you control "Toy Box", you can add 1 Level 4 LIGHT monster instead.
--トイ・ソルジャー --Toy Soldier --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Can be Set as a Spell local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MONSTER_SSET) e1:SetValue(TYPE_SPELL) c:RegisterEffect(e1) --Special Summon itself if it was sent to the GY while it was Set in the Spell/Trap Zone 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_TO_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Search 1 "Toy Box" or 1 Level 4 LIGHT monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end s.listed_names={CARD_TOY_BOX} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_STZONE) and c:IsPreviousPosition(POS_FACEDOWN) 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,hasbox) return c:IsAbleToHand() and (c:IsCode(CARD_TOY_BOX) or (hasbox and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_LIGHT))) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local hasbox=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_TOY_BOX),tp,LOCATION_ONFIELD,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,hasbox) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local hasbox=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_TOY_BOX),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,hasbox) 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 reveal this card in your hand; immediately after this effect resolves, Normal Summon 1 DARK Machine monster. You can target 1 monster you control; destroy it, then you can Special Summon 1 "Engine Token" (Machine/EARTH/Level 1/ATK 200/DEF 200) in Attack Position. You can only use each effect of "Motor Kaiser" once per turn.
--モーター・カイザル --Motor Kaiser --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Normal Summon 1 DARK Machine monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfReveal) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) c:RegisterEffect(e1) --Destroy 1 monster you control, then you can Special Summon 1 "Engine Token" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end s.listed_names={TOKEN_ENGINE} function s.sumfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_MACHINE) and c:IsSummonable(true,nil) end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_MZONE) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local sc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil):GetFirst() if sc then Duel.Summon(tp,sc,true,nil) end end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) 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,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_ENGINE,0,TYPES_TOKEN,200,200,1,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP_ATTACK) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then local token=Duel.CreateToken(tp,TOKEN_ENGINE) Duel.BreakEffect() Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] You cannot Special Summon monsters, except "Qli" monsters. This effect cannot be negated. Once per turn: You can pay 800 LP; add 1 "Qli" card from your Deck to your hand, except "Qliphort Scout". ---------------------------------------- [ Flavor Text ] Booting in Replica Mode... An error has occurred while executing C:\sophia\zefra.exe Unknown publisher. Allow C:\tierra\qliphort.exe ? <Y/N>...[Y] Booting in Autonomy Mode...
--クリフォート・ツール --Qliphort Scout local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --splimit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e2:SetRange(LOCATION_PZONE) e2:SetTargetRange(1,0) e2:SetTarget(s.splimit) c:RegisterEffect(e2) --tohand 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_PZONE) e3:SetCountLimit(1) e3:SetCost(Cost.PayLP(800)) e3:SetTarget(s.target) e3:SetOperation(s.operation) c:RegisterEffect(e3) end s.listed_series={SET_QLI} s.listed_names={id} function s.splimit(e,c,tp,sumtp,sumpos) return not c:IsSetCard(SET_QLI) end function s.filter(c) return c:IsSetCard(SET_QLI) and not c:IsCode(id) 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) if not e:GetHandler():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:
1 Tuner + 1 or more non-Tuner monsters If this card is Special Summoned: You can add 1 "Yang Zing" card from your Deck to your hand. Once per turn: You can send 1 Wyrm-Type monster from your Deck to the Graveyard; this card's Level becomes the sent monster's. If this face-up card leaves the field: You can Special Summon 1 "Yang Zing" monster from your Deck. You can only Special Summon "Denglong, First of the Yang Zing(s)" once per turn.
--源竜星-ボウテンコウ --Denglong, First of the Yang Zing local s,id=GetID() function s.initial_effect(c) c:SetSPSummonOnce(id) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),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_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --change levels local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCost(s.lvcost) e2:SetOperation(s.lvop) c:RegisterEffect(e2) --special summon 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_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_YANG_ZING} function s.thfilter(c) return c:IsSetCard(SET_YANG_ZING) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.costfilter(c,lv) local clv=c:GetLevel() return clv>0 and clv~=lv and c:IsRace(RACE_WYRM) and c:IsAbleToGraveAsCost() end function s.lvcost(e,tp,eg,ep,ev,re,r,rp,chk) local lv=e:GetHandler():GetLevel() if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil,lv) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil,lv) Duel.SendtoGrave(g,REASON_COST) e:SetLabel(g:GetFirst():GetLevel()) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local lv=e:GetLabel() if c:IsRelateToEffect(e) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(lv) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_YANG_ZING) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.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) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Special Summon this card from your hand by returning 1 face-up "Mist Valley" monster you control to the hand. If you do, this card's ATK becomes 1700.
--ミスト・コンドル --Mist Condor local s,id=GetID() function s.initial_effect(c) --special summon procedure local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_MIST_VALLEY} function s.spfilter(c,ft) return c:IsFaceup() and c:IsSetCard(SET_MIST_VALLEY) and c:IsAbleToHandAsCost() and (ft>0 or c:GetSequence()<5) end function s.spcon(e,c) if c==nil then return true end local tp=e:GetHandlerPlayer() local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,ft) return ft>-1 and #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,1,nil,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local g=nil local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,Duel.GetLocationCount(tp,LOCATION_MZONE)) local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_RTOHAND,nil,nil,true) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.SendtoHand(g,nil,REASON_COST) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(1700) e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD)) e:GetHandler():RegisterEffect(e1) g:DeleteGroup() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Plant Normal Monster If a "Sunavalon" Link Monster you control leaves the field by card effect: Destroy this card. If this card is Special Summoned: You can target 1 "Sunavalon" Link Monster on the field; gain LP equal to its Link Rating x 300. When your Plant Link Monster inflicts battle damage to your opponent: You can gain 600 LP.
--聖蔓の癒し手 --Sunvine Healer local s,id=GetID() function s.initial_effect(c) --link summon c:EnableReviveLimit() Link.AddProcedure(c,s.matfilter,1,1) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_LEAVE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetTarget(s.rectg) e2:SetOperation(s.recop) c:RegisterEffect(e2) --recover local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_RECOVER) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetCondition(s.reccon2) e3:SetTarget(s.rectg2) e3:SetOperation(s.recop2) c:RegisterEffect(e3) end s.listed_series={SET_SUNAVALON} function s.matfilter(c,lc,st,tp) return c:IsRace(RACE_PLANT,lc,st,tp) and c:IsType(TYPE_NORMAL,lc,st,tp) end function s.cfilter(c,tp,rp) return c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(SET_SUNAVALON) and c:IsType(TYPE_LINK) and c:GetPreviousControler()==tp and c:IsReason(REASON_EFFECT) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp,rp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) 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) if e:GetHandler():IsRelateToEffect(e) then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end function s.recfilter(c) return c:IsFaceup() and c:IsSetCard(SET_SUNAVALON) and c:IsType(TYPE_LINK) end function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.recfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetLink()*300) end function s.recop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:GetLink()>0 then Duel.Recover(tp,tc:GetLink()*300,REASON_EFFECT) end end function s.filter(c,tp) return c:IsControler(tp) and c:IsType(TYPE_LINK) and c:IsRace(RACE_PLANT) end function s.reccon2(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and eg:IsExists(s.filter,1,nil,tp) end function s.rectg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(600) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,600) end function s.recop2(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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 WATER monster from your hand or face-up field to the GY; Special Summon 1 monster from your hand or Deck with the same name as 1 WATER monster you control, also you cannot Special Summon for the rest of this turn after this card resolves, except WATER monsters. You can banish this card from your GY; add 1 "Ice Doll" from your Deck or GY to your hand. You can only use each effect of "Ice Doll Mirror" once per turn.
--アイス・ドール・ミラー --Ice Doll Mirror --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) --Special Summmon 1 monster from your hand or Deck with the same name as 1 WATER monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Add 1 "Ice Doll" from your Deck or GY 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:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_names={97476032} --"Ice Doll" function s.spcostfilter(c,e,tp) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,c,e,tp,c) end function s.spfilter(c,e,tp,cost_c) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.samenamefilter,tp,LOCATION_MZONE,0,1,cost_c,c:GetCode()) end function s.samenamefilter(c,code) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup() and c:IsCode(code) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SendtoGrave(g,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local cost_chk=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0 e:SetLabel(0) return cost_chk 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 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 if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end --Cannot Special Summon for the rest of this turn after this card resolves, except WATER monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(e,c) return c:IsAttributeExcept(ATTRIBUTE_WATER) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.thfilter(c) return c:IsCode(97476032) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Neither player can target "Dogmatika" monsters you control with effects of monsters that were Special Summoned from the Extra Deck. You can only use each of the following effects of "Dogmatika Nation" once per turn. ● After damage calculation, if your "Dogmatika" monster battled an opponent's monster: You can destroy that opponent's monster. ● If this face-up card in the Field Zone is destroyed by an opponent's card effect: You can have each player send 1 monster from their Extra Deck to the GY. * The above text is unofficial and describes the card's functionality in the OCG.
--教導国家ドラグマ --Dogmatika Nation --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) --Cannot be target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_DOGMATIKA)) e2:SetValue(s.tgval) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLED) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --Send to the graveyard local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOGRAVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCountLimit(1,{id,1}) e4:SetCondition(s.gycon) e4:SetTarget(s.gytg) e4:SetOperation(s.gyop) c:RegisterEffect(e4) end s.listed_series={SET_DOGMATIKA} function s.tgval(e,re,rp) return re:IsMonsterEffect() and re:GetHandler():IsSpecialSummoned() and re:GetHandler():IsSummonLocation(LOCATION_EXTRA) end function s.check(c,tp) return c and c:IsControler(tp) and c:IsSetCard(SET_DOGMATIKA) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetAttackTarget()~=nil and (s.check(Duel.GetAttacker(),tp) or s.check(Duel.GetAttackTarget(),tp)) end if s.check(Duel.GetAttacker(),tp) then Duel.SetTargetCard(Duel.GetAttackTarget()) else Duel.SetTargetCard(Duel.GetAttacker()) end end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.gycon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp==1-tp and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0) * Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA) > 0 end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,PLAYER_ALL,LOCATION_EXTRA) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) local sg=Group.CreateGroup() for p=0,1 do Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(p,Card.IsAbleToGrave,p,LOCATION_EXTRA,0,1,1,nil) if #g>0 then sg:AddCard(g:GetFirst()) end end if #sg>0 then Duel.SendtoGrave(sg,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 Level 5 "Chronomaly" monster in your Graveyard; Special Summon that target. You cannot Special Summon monsters the turn you activate this effect, except "Chronomaly" monsters.
--先史遺産ウィングス・スフィンクス --Chronomaly Winged Sphinx 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_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) 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_CHRONOMALY} function s.counterfilter(c) return c:IsSetCard(SET_CHRONOMALY) 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+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,1),nil) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(SET_CHRONOMALY) end function s.filter(c,e,tp) return c:GetLevel()==5 and c:IsSetCard(SET_CHRONOMALY) 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.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) 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:
When this card is Tribute Summoned: You can banish 1 Spell Card from your Graveyard; add 1 card with the same name as the banished Spell Card from your Deck to your hand.
--魔帝アングマール --Angmarl the Fiendish Monarch local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() end function s.cfilter(c,tp) return c:IsSpell() and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode()) end function s.thfilter(c,code) return c:IsCode(code) and c:IsAbleToHand() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp) e:SetLabel(g:GetFirst():GetCode()) 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.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.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a Thunder-Type monster. It gains 100 ATK for each Thunder-Type monster in your Graveyard. You can send this face-up card from the field to the Graveyard to have 1 face-up Thunder-Type monster you control gain 1000 ATK.
--エレキューブ --Wattcube local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_THUNDER)) --Atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(s.val) c:RegisterEffect(e2) --atkup local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_ATKCHANGE) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_SZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCost(Cost.SelfToGrave) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_THUNDER) end function s.val(e,c) return Duel.GetMatchingGroupCount(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,nil,RACE_THUNDER)*100 end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and s.filter(tc) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(1000) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can either: Target 1 "X-Head Cannon" you control; equip this card to that target, OR: Unequip this card and Special Summon it. A monster equipped with this card gains 400 ATK/DEF, also if the equipped monster would be destroyed by battle or card effect, destroy this card instead.
--Y-ドラゴン・ヘッド --Y-Dragon Head local s,id=GetID() function s.initial_effect(c) aux.AddUnionProcedure(c,aux.FilterBoolFunction(Card.IsCode,62651957)) --Atk up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(400) c:RegisterEffect(e1) --Def up local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) end s.listed_names={62651957}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
For a Synchro Summon, you can substitute this card for any 1 "Nordic" Tuner. You can only use each of the following effects of "Nordic Beast Gullinbursti" once per turn. If this card is Normal or Special Summoned: You can Special Summon 1 "Nordic" monster from your hand. You can target 1 "Nordic" monster in your GY, except "Nordic Beast Gullinbursti"; add it to your hand.
--極星獣グリンブルスティ --Nordic Beast Gullinbursti --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Synchro Substitute local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SYNSUB_NORDIC) c:RegisterEffect(e0) --Special Summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Add to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_names={id} s.listed_series={SET_NORDIC} function s.spfilter(c,e,tp) return c:IsSetCard(SET_NORDIC) 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.thfilter(c) return c:IsSetCard(SET_NORDIC) and c:IsMonster() 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:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters you control as Fusion Materials. If you have 2 cards in your Pendulum Zones, you can also use cards in your Pendulum Zones as Fusion Material(s). You can only activate 1 "Pendulum Fusion" per turn.
--ペンデュラム・フュージョン --Pendulum Fusion local s,id=GetID() function s.initial_effect(c) --Activate local e1=Fusion.CreateSummonEff(c,nil,Fusion.OnFieldMat,s.fextra) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e1) end function s.fextra(e,tp,mg) if Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)==2 then return Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_PZONE,0,nil) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target any number of "Vylon" Monster Cards you control that are Equip Cards; Special Summon them in face-up Defense Position. Banish them when they leave the field.
--ヴァイロン・ポリトープ --Vylon Polytope local s,id=GetID() function s.initial_effect(c) --Special Summon any number of "Vylon" Monster Cards you control that are Equip Cards local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_VYLON} function s.spfilter(c,e,tp) return c:IsSetCard(SET_VYLON) and c:IsMonsterCard() and c:IsEquipCard() and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return ft>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_SZONE,0,1,ft,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e):Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false,POS_FACEUP_DEFENSE) if #tg==0 or (#tg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then return end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local exg=nil if #tg>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=tg:Select(tp,ft,ft,nil) tg,exg=tg:Split(function(c) return sg:IsContains(c) end,nil) end local c=e:GetHandler() for tc in tg:Iter() do if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) 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_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) tc:RegisterEffect(e1,true) end end Duel.SpecialSummonComplete() if exg then Duel.SendtoGrave(exg,REASON_RULE,PLAYER_NONE,PLAYER_NONE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Shuffle 1 "Harpie Lady Sisters" from your Monster Zone into the Deck, then you can Special Summon 3 "Harpie" monsters with different original names, 1 each from your hand, Deck, and GY. For the rest of this turn after this card resolves, you cannot Special Summon monsters, except WIND monsters. If this card you control is destroyed by a "Harpie" card's effect or your opponent's card effect: Add 1 "Harpie" monster from your Deck to your hand. You can only use each effect of "Harpie Lady Elegance" once per turn.
--華麗なるハーピィ・レディ --Harpie Lady Elegance --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Shuffle 1 "Harpie Lady Sisters" into the Deck and Special Summon 3 "Harpie" monsters local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK|CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Add 1 "Harpie" monster from the Deck to the hand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_HARPIE} s.listed_names={CARD_HARPIE_LADY_SISTERS} function s.tdfilter(c,e,tp,g) return c:IsCode(CARD_HARPIE_LADY_SISTERS) and c:IsFaceup() and c:IsAbleToDeck() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_TOFIELD)>=3 and aux.SelectUnselectGroup(g,e,tp,3,3,s.spcheck,0) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_HARPIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spcheck(sg,e,tp,mg) return sg:GetClassCount(Card.GetOriginalCodeRule)==#sg and sg:GetClassCount(Card.GetLocation)==#sg end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp) return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,g) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_MZONE) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local dg=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,g) if #dg>0 and Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then Duel.BreakEffect() local sg=aux.SelectUnselectGroup(g,e,tp,3,3,s.spcheck,1,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end --Cannot Special Summon non-WIND monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.splimit(e,c) return not c:IsAttribute(ATTRIBUTE_WIND) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_ONFIELD) and (rp==1-tp or (rp==tp and re:GetHandler():IsSetCard(SET_HARPIE))) and c:IsPreviousControler(tp) end function s.thfilter(c) return c:IsMonster() and c:IsSetCard(SET_HARPIE) and c:IsAbleToHand() 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,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 Level 4 monsters Once per turn, when this attacking card destroys an opponent's monster by battle and sends it to the Graveyard: You can detach 1 Xyz Material from this card; Special Summon the destroyed monster to your opponent's side of the field in Attack Position, also it loses 1000 ATK, and if you do Summon this way, this card can make a second attack during this Battle Phase.
--No.32 海咬龍シャーク・ドレイク --Number 32: Shark Drake local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Xyz summon procedure Xyz.AddProcedure(c,nil,4,3) --Make itself be able to make a second attack 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:SetCountLimit(1) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.atcon) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.attg) e1:SetOperation(s.atop) c:RegisterEffect(e1) end s.xyz_number=32 function s.atcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c==Duel.GetAttacker() and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() end function s.attg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.GetAttackTarget():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,1-tp) end Duel.GetAttackTarget():CreateEffectRelation(e) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,Duel.GetAttackTarget(),1,0,0) end function s.atop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=Duel.GetAttackTarget() if not bc:IsRelateToEffect(e) then return end if Duel.SpecialSummonStep(bc,0,tp,1-tp,false,false,POS_FACEUP_ATTACK) then --Special summoned monster loses 1000 ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-1000) e1:SetReset(RESET_EVENT|RESETS_STANDARD) bc:RegisterEffect(e1) Duel.SpecialSummonComplete() if c:IsFaceup() and c:IsRelateToEffect(e) then Duel.BreakEffect() --Can make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(3201) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Declare 1 card name; banish 1 of that declared card from your Main Deck, and if you do, negate its effects, as well as the activated effects and effects on the field of cards with the same original name, until the end of this turn. You can only activate 1 "Crossout Designator" per turn.
--抹殺の指名者 --Crossout Designator --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil) local ids={} for tc in aux.Next(g) do ids[tc:GetCode()]=true end s.announce_filter={} for code,i in pairs(ids) do if #s.announce_filter==0 then table.insert(s.announce_filter,code) table.insert(s.announce_filter,OPCODE_ISCODE) else table.insert(s.announce_filter,code) table.insert(s.announce_filter,OPCODE_ISCODE) table.insert(s.announce_filter,OPCODE_OR) end end local ac=Duel.AnnounceCard(tp,table.unpack(s.announce_filter)) Duel.SetTargetParam(ac) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER) end function s.rmfilter(c,ac) return c:IsCode(ac) and c:IsAbleToRemove() end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_DECK,0,1,1,nil,ac) local tc=g:GetFirst() if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then local c=e:GetHandler() local code=tc:GetOriginalCodeRule() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DISABLE) e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD) e1:SetLabel(code) e1:SetTarget(s.distg) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVING) e2:SetLabel(code) e2:SetCondition(s.discon) e2:SetOperation(s.disop) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) local e3=e1:Clone() e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) Duel.RegisterEffect(e3,tp) end end function s.distg(e,c) return c:IsOriginalCodeRule(e:GetLabel()) end function s.discon(e,tp,eg,ep,ev,re,r,rp) return re:GetHandler():IsOriginalCodeRule(e:GetLabel()) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can either: Target 1 face-up "Six Samurai" monster you control; equip this card to that target, OR: Unequip this card and Special Summon it in face-up Attack Position. While equipped by this effect, the equipped monster gains 500 ATK and DEF. If the equipped monster destroys an opponent's monster by battle: Draw 1 card. (A monster can only be equipped with 1 Union Monster at a time. If the equipped monster would be destroyed, destroy this card instead.)
--六武衆の御霊代 --Spirit of the Six Samurai local s,id=GetID() function s.initial_effect(c) aux.AddUnionProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,SET_SIX_SAMURAI),true,false) --Atk up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetCondition(aux.IsUnionState) c:RegisterEffect(e1) --Def up local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_SZONE) e1:SetCondition(s.drcon) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) end s.listed_series={SET_SIX_SAMURAI} function s.drcon(e,tp,eg,ep,ev,re,r,rp) return aux.IsUnionState(e) and e:GetHandler():GetEquipTarget()==eg:GetFirst() end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(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.Draw(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon any number of "Valkyrie" monsters with different names from your hand. If you Special Summoned 3 or more monsters with this effect, you take no battle damage until the end of the next turn. During the End Phase of the turn you activated this card, shuffle all monsters you control into the Deck. You can banish this card from your GY; add 1 "Mischief of the Time Goddess" from your Deck to your hand. You can only use this effect of "Ride of the Valkyries" once per turn.
--Walkuren Ritt --Ride of the Valkyries --scripted by Naim and AlphaKretin 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:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Search "Mischief of the Time Goddess" local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_VALKYRIE} s.listed_names={92182447} function s.filter(c,e,tp) return c:IsSetCard(SET_VALKYRIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,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) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local c=e:GetHandler() if ft>5 then ft=5 end local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND,0,nil,e,tp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local g=aux.SelectUnselectGroup(sg,e,tp,1,ft,aux.dncheck,1,tp,HINTMSG_SPSUMMON) if #g>0 then local ct=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) if ct>2 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetValue(function(e,re,dam,r,rp,rc) if r&REASON_BATTLE>0 then return 0 else return dam end end) e1:SetReset(RESET_PHASE|PHASE_END,2) Duel.RegisterEffect(e1,tp) end end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetOperation(s.tdop) Duel.RegisterEffect(e2,tp) end end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end function s.thfilter(c) return c:IsCode(92182447) 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 tc=Duel.GetFirstMatchingCard(s.thfilter,tp,LOCATION_DECK,0,nil) if tc then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster effect is activated in the hand or GY: Negate the activation, and if you do, banish it.
--透破抜き --Debunk local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) return (loc==LOCATION_HAND or loc==LOCATION_GRAVE) and re:IsMonsterEffect() and Duel.IsChainNegatable(ev) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local rc=re:GetHandler() local relation=rc:IsRelateToEffect(re) if chk==0 then return rc:IsAbleToRemove(tp) or (not relation and Duel.IsPlayerCanRemove(tp)) end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if relation then Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,rc:GetControler(),rc:GetLocation()) else Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,0,rc:GetPreviousLocation()) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Beast-Warrior monsters, including a WIND "Ancient Warriors" monster All "Ancient Warriors" monsters you control gain 500 ATK/DEF. You can only use each of the following effects of "Ancient Warriors Oath - Double Dragon Lords" once per turn. If this card is Link Summoned: You can add 1 "Ancient Warriors" card from your Deck to your hand. (Quick Effect): You can send 1 card from your hand or field to the GY, then target 1 face-up card your opponent controls; return it to the hand.
--戦華盟将-双龍 --Ancient Warriors Oath - Double Dragon Lords --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Link summon c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_BEASTWARRIOR),2,2,s.lcheck) --Add to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Increase ATK/DEF local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_ANCIENT_WARRIORS)) e2:SetValue(500) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) --Return to hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e4:SetCountLimit(1,{id,1}) e4:SetCost(s.cost) e4:SetTarget(s.target) e4:SetOperation(s.operation) c:RegisterEffect(e4) end s.listed_series={SET_ANCIENT_WARRIORS} function s.lfilter(c,lc,sumtype,tp) return c:IsSetCard(SET_ANCIENT_WARRIORS,lc,sumtype,tp) and c:IsAttribute(ATTRIBUTE_WIND,lc,sumtype,tp) end function s.lcheck(g,lc,sumtype,tp) return g:IsExists(s.lfilter,1,nil,lc,sumtype,tp) end function s.thfilter(c) return c:IsSetCard(SET_ANCIENT_WARRIORS) and c:IsAbleToHand() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLinkSummoned() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.filter(c) return c:IsFaceup() and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,LOCATION_ONFIELD) 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) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent draws a card(s): Increase this card's Level by the number drawn. While this card's Level is higher than its original Level, it gains ATK equal to the difference x 500. When your opponent activates a Spell Card or effect, while you control "Shining Sarcophagus" (Quick Effect): You can negate the activation, and if you do, increase this card's Level by 1. You can only use this effect of "Silent Magician Zero" once per turn.
--サイレント・マジシャン・ゼロ --Silent Magician Zero --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Increase this card's Level by the number of drawn cards local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_LVCHANGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_DRAW) e1:SetRange(LOCATION_MZONE) e1:SetCondition(function(e,tp,_,ep) return e:GetHandler():HasLevel() and ep==1-tp end) e1:SetOperation(s.lvop) c:RegisterEffect(e1) --Gains ATK equal to the difference between its current Level and its original Level x 500 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetValue(s.atkval) c:RegisterEffect(e2) --Negate opponent's Spell effects local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_LVCHANGE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCondition(s.negcon) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) c:RegisterEffect(e3) end s.listed_names={CARD_SHINING_SARCOPHAGUS} function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() and c:HasLevel() then --Increase its Level by the number of drawn cards local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(ev) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.atkval(e,c) local ct=c:GetLevel()-c:GetOriginalLevel() return ct>0 and ct*500 end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsSpellEffect() and Duel.IsChainNegatable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_SHINING_SARCOPHAGUS),tp,LOCATION_ONFIELD,0,1,nil) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():HasLevel() end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function s.negop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.NegateActivation(ev) and c:IsRelateToEffect(e) and c:IsFaceup() and c:HasLevel() then --Increase its Level by 1 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(1) 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:
If this card is Normal or Special Summoned: You can add 1 "Rescue-ACE" Spell from your Deck to your hand. When your opponent activates a monster effect on the field (Quick Effect): You can Tribute this card from your hand or face-up field; Special Summon 1 "Rescue-ACE" monster from your hand, except "Rescue-ACE Air Lifter". You can only use each effect of "Rescue-ACE Air Lifter" once per turn.
--R-ACEエアホイスター --Rescue-ACE Air Lifter --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Add to hand 1 "Rescue-ACE" Spell from Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Tribute itself and Special Summon 1 "Rescue-ACE" monster from the hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_HAND|LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.spcond) e3:SetCost(Cost.SelfTribute) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_RESCUE_ACE} s.listed_names={id} function s.thfilter(c) return c:IsSetCard(SET_RESCUE_ACE) and c:IsSpell() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.spcond(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsMonsterEffect() and re:GetActivateLocation()==LOCATION_MZONE end function s.spfilter(c,e,tp) return c:IsSetCard(SET_RESCUE_ACE) 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) local c=e:GetHandler() if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c,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 Normal Summoned: You can target 1 Normal Monster with 1000 or less ATK in your Graveyard; Special Summon that target in face-up Defense Position. Once per turn: You can Tribute 1 Dragon-Type monster, then target 1 face-up monster you control; until the End Phase, its Level becomes 8, and if it does, it gains 800 ATK.
--ドラゴラド --Dragard 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --lvatkup local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCost(s.lvcost) e2:SetTarget(s.lvtg) e2:SetOperation(s.lvop) c:RegisterEffect(e2) end function s.spfilter(c,e,tp) return c:IsAttackBelow(1000) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.cfilter(c,tp) return c:IsRace(RACE_DRAGON) and Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,c) end function s.lvfilter(c) local lv=c:GetLevel() return c:IsFaceup() and lv>0 and lv~=8 end function s.lvcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,tp) end local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,tp) Duel.Release(g,REASON_COST) 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 true 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() and tc:GetLevel()~=8 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) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(800) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 non-Link Monsters During your opponent's Main Phase, you can (Quick Effect): Immediately after this effect resolves, Link Summon 1 Link Monster using materials you control, including this card. You can only use this effect of "I:P Masquerena" once per turn. A Link Monster that used this card as material cannot be destroyed by your opponent's card effects.
--I:Pマスカレーナ --I:P Masquerena --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Link summon procedure Link.AddProcedure(c,s.matfilter,2,2) --Link summon 1 link monster during opponent's main phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --A link monster using this card cannot be destroyed by opponent's card effects local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(s.indcon) e2:SetOperation(s.indop) c:RegisterEffect(e2) end function s.matfilter(c,lc,st,tp) return not c:IsType(TYPE_LINK,lc,st,tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end local g=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,nil,c) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.LinkSummon(tp,sg:GetFirst(),c) end end function s.indcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_LINK end function s.indop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() --Cannot be destroyed by opponent's card effects local e1=Effect.CreateEffect(c) e1:SetDescription(3060) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetValue(s.indval) e1:SetOwnerPlayer(ep) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1,true) end function s.indval(e,re,rp) return rp==1-e:GetOwnerPlayer() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When an opponent's monster declares an attack: You choose the target of the attack.
--地縛霊の誘い --Call of the Earthbound local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local ag,da=eg:GetFirst():GetAttackableTarget() local at=Duel.GetAttackTarget() return ag:IsExists(aux.TRUE,1,at) or (at~=nil and da) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local ag,da=eg:GetFirst():GetAttackableTarget() local at=Duel.GetAttackTarget() if da and at~=nil then local sel=0 Duel.Hint(HINT_SELECTMSG,tp,31) if ag:IsExists(aux.TRUE,1,at) then sel=Duel.SelectOption(tp,1213,1214) else sel=Duel.SelectOption(tp,1213) end if sel==0 then Duel.ChangeAttackTarget(nil) return end end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACKTARGET) local g=ag:Select(tp,1,1,at) local tc=g:GetFirst() if tc then Duel.ChangeAttackTarget(tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner WATER monsters Once per turn: You can discard up to 2 cards to the GY, then target the same number of cards your opponent controls; destroy them.
--氷結界の龍 グングニール --Gungnir, Dragon of the Ice Barrier local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsAttribute,ATTRIBUTE_WATER),1,99) c:EnableReviveLimit() --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.costfilter(c) return c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local rt=math.min(2,Duel.GetTargetCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)) if chk==0 then return aux.IceBarrierDiscardCost(s.costfilter,true,1,rt)(e,tp,eg,ep,ev,re,r,rp,0) end e:SetLabel(aux.IceBarrierDiscardCost(s.costfilter,true,1,rt)(e,tp,eg,ep,ev,re,r,rp,1)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end local ct=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local eg=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,ct,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,ct,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetTargetCards(e) if #rg>0 then Duel.Destroy(rg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can Special Summon 1 "Ganbara Lancer" from your hand or Graveyard in face-up Defense Position.
--ガンバランサー --Ganbara Lancer 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.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_names={id} function s.filter(c,e,tp) return 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) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Fusion Summon 1 Cyberse Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Material. If you control no monsters in the Extra Monster Zone, you can also banish up to 1 Cyberse Link Monster from your GY as Fusion Material.
--サイバネット・フュージョン --Cynet Fusion local s,id=GetID() function s.initial_effect(c) local e1=Fusion.CreateSummonEff({handler=c,fusfilter=aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE), extrafil=s.fextra,extraop=s.extraop,extratg=s.extratg}) c:RegisterEffect(e1) end function s.fcheck(tp,sg,fc) return sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1 end function s.exfilter0(c) return c:IsLinkMonster() and c:IsRace(RACE_CYBERSE) and c:IsAbleToRemove() end function s.fextra(e,tp,mg) if Duel.GetFieldGroupCount(tp,LOCATION_EMZONE,0)==0 and not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then local eg=Duel.GetMatchingGroup(s.exfilter0,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) if #eg>0 then return eg,s.fcheck end end return nil end function s.extraop(e,tc,tp,sg) local rg=sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE) if #rg>0 then Duel.Remove(rg,POS_FACEUP,REASON_EFFECT|REASON_MATERIAL|REASON_FUSION) sg:Sub(rg) end end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this Set card is destroyed and sent to the GY: Special Summon 1 "Wicked Token" (Fiend/DARK/Level 4/ATK 1000/DEF 1000).
--黄金の邪神像 --Statue of the Wicked local s,id=GetID() function s.initial_effect(c) --token local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_names={65810490} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return r&REASON_DESTROY~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEDOWN) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,1000,1000,4,RACE_FIEND,ATTRIBUTE_DARK) then local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Visas Starfrost" + 1 monster with 1500 ATK/2100 DEF Must be Special Summoned (from your Extra Deck) by banishing the above cards from your field and/or GY. Cannot be destroyed by battle. If this card is Special Summoned: You can target 1 other monster on the field; destroy it, and if you do, this card gains ATK equal to half of that monster's original ATK or DEF (whichever is higher).
--ヴィシャス=アストラウド --Vicious Astraloud --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --"Visas Starfrost" + 1 monster with 1500 ATK/2100 DEF Fusion.AddProcMix(c,true,true,CARD_VISAS_STARFROST,s.matfilter) Fusion.AddContactProc(c,s.contactfil,s.contactop,true) --Destroy 1 other monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Cannot be destroyed by battle local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(1) c:RegisterEffect(e2) end s.listed_names={CARD_VISAS_STARFROST} function s.matfilter(c) return c:IsMonster() and c:IsAttack(1500) and c:IsDefense(2100) end function s.contactfil(tp) local loc=LOCATION_ONFIELD|LOCATION_GRAVE if Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then loc=LOCATION_ONFIELD end return Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,loc,0,nil) end function s.contactop(g) Duel.Remove(g,POS_FACEUP,REASON_COST|REASON_MATERIAL) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or Duel.Destroy(tc,REASON_EFFECT)==0 then return end local c=e:GetHandler() local val=math.max(tc:GetTextAttack(),tc:GetTextDefense())//2 if val>0 and c:IsRelateToEffect(e) and c:IsFaceup() then c:UpdateAttack(val,RESET_EVENT|RESETS_STANDARD_DISABLE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent activates a Normal Spell Card: Pay 1000 LP; the activated effect of that Normal Spell becomes "Your opponent discards 1 random card".
--闇の取引 --Dark Deal local s,id=GetID() function s.initial_effect(c) --Change effect of Normal Spell to "Your opponent discards 1 random card" local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetCost(Cost.PayLP(1000)) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler() return ep==1-tp and rc:IsNormalSpell() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Group.CreateGroup() Duel.ChangeTargetCard(ev,g) Duel.ChangeChainOperation(ev,s.repop) end function s.repop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():CancelToGrave(false) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if #g>0 then local sg=g:RandomSelect(1-tp,1,nil) Duel.SendtoGrave(sg,REASON_EFFECT|REASON_DISCARD) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time a monster(s) is sent to your opponent's GY: Inflict 300 damage to your opponent.
--棺桶売り --Coffin Seller local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.filter(c,tp) return c:IsMonster() and c:IsControler(1-tp) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToEffect(e) end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,300) end function s.operation(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.Damage(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is in your Graveyard: You can banish 1 Insect-Type monster from your Graveyard to target 1 face-up "Inzektor" monster you control; equip this card from the Graveyard to that target. This effect of "Inzektor Giga-Cricket" can only be used once per turn. While this card is equipped to a monster, that monster's original ATK becomes 2000, and if it attacks a Defense Position monster, inflict piercing Battle Damage to your opponent.
--甲虫装機 ギガグリオル --Inzektor Giga-Cricket local s,id=GetID() function s.initial_effect(c) --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_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(s.eqcost) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --equip effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_SET_BASE_ATTACK) e2:SetValue(2000) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_PIERCE) c:RegisterEffect(e3) end s.listed_series={SET_INZEKTOR} function s.cfilter(c,tp) return c:IsRace(RACE_INSECT) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,c) end function s.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,e:GetHandler(),tp) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_INZEKTOR) 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) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) end function s.eqlimit(e,c) return c==e:GetLabelObject() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent controls a monster and you control no monsters, you can Special Summon this card (from your hand). If this card attacks a Defense Position monster, inflict piercing battle damage to your opponent. When this card inflicts battle damage to your opponent: You can add 1 "Heroic" card from your Deck to your hand.
--H・C 強襲のハルベルト --Heroic Challenger - Assault Halberd 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) --pierce local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_PIERCE) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_HEROIC} function s.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function s.filter(c) return c:IsSetCard(SET_HEROIC) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Monsters your opponent controls lose 200 ATK for each LIGHT Beast monster in your field and GY. Once per Chain, if you Synchro Summon a LIGHT Beast monster: You can draw 1 card, then place 1 card from your hand on the bottom of the Deck. You can banish this card from your GY, then target 1 "Yummy" monster you control and 1 monster your opponent controls; switch control of those 2 monsters. You can only use this effect of "Yummy★Redemption" once per turn.
--ヤミー★リデンプション --Yummy★Redemption --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e0:SetCode(EVENT_FREE_CHAIN) e0:SetHintTiming(TIMING_DAMAGE_STEP) e0:SetCondition(aux.StatChangeDamageStepCondition) c:RegisterEffect(e0) --Monsters your opponent controls lose 200 ATK for each LIGHT Beast monster you control and in your GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_SZONE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) --Draw 1 card, then place 1 card from your hand on the bottom of the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e2:SetCondition(s.drwcon) e2:SetTarget(s.drwtg) e2:SetOperation(s.drwop) c:RegisterEffect(e2) --Switch control of 1 "Yummy" monster you control and 1 monster your opponent controls local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_CONTROL) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_GRAVE) e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e3:SetCountLimit(1,id) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.ctrltg) e3:SetOperation(s.ctrlop) c:RegisterEffect(e3) end s.listed_series={SET_YUMMY} function s.atkvalfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST) and c:IsFaceup() end function s.atkval(e,c) return -200*Duel.GetMatchingGroupCount(s.atkvalfilter,e:GetHandlerPlayer(),LOCATION_MZONE|LOCATION_GRAVE,0,nil) end function s.drwconfilter(c,tp) return c:IsSynchroSummoned() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST) and c:IsSummonPlayer(tp) and c:IsFaceup() end function s.drwcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.drwconfilter,1,nil,tp) end function s.drwtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.drwop(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,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil) if #g>0 then Duel.BreakEffect() Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end function s.selffilter(c,e,tp) return c:IsSetCard(SET_YUMMY) and c:IsAbleToChangeControler() and c:IsFaceup() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and c:IsCanBeEffectTarget(e) end function s.oppfilter(c,e,tp) return c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and c:IsCanBeEffectTarget(e) end function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.selffilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.IsExistingTarget(s.oppfilter,tp,0,LOCATION_MZONE,1,nil,e,1-tp) end local g1=Duel.GetMatchingGroup(s.selffilter,tp,LOCATION_MZONE,0,nil,e,tp) local g2=Duel.GetMatchingGroup(s.oppfilter,tp,0,LOCATION_MZONE,nil,e,1-tp) g1:Merge(g2) local tg=aux.SelectUnselectGroup(g1,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_CONTROL) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_CONTROL,tg,2,tp,0) end function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg==2 then Duel.SwapControl(tg:GetFirst(),tg:GetNext()) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during your Main Phase: You can destroy up to 3 other "Igknight" cards you control, then return an equal number of cards your opponent controls to the hand. If this card is sent to the Graveyard: You can add 1 face-up "Igknight" Pendulum Monster from your Extra Deck to your hand.
--イグナイト・バースト --Igknight Burst local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) --to hand local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_TO_GRAVE) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_IGKNIGHT} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if s.descon(e,tp,eg,ep,ev,re,r,rp) and s.destg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then e:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND) e:SetOperation(s.desop) s.destg(e,tp,eg,ep,ev,re,r,rp,1) else e:SetCategory(0) e:SetOperation(nil) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and (Duel.IsMainPhase()) end function s.desfilter(c) return c:IsFaceup() and c:IsSetCard(SET_IGKNIGHT) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) and e:GetHandler():GetFlagEffect(id)==0 end e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_END,0,1) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil) local ct=#g if ct==0 then return end if ct>3 then ct=3 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,ct,e:GetHandler()) local ct2=Duel.Destroy(dg,REASON_EFFECT) if ct2>0 then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local rg=g:Select(tp,ct2,ct2,nil) Duel.HintSelection(rg) Duel.SendtoHand(rg,nil,REASON_EFFECT) end end function s.thfilter(c) return c:IsFaceup() and c:IsSetCard(SET_IGKNIGHT) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with "Impcantation Inception". You can reveal this card in your hand; discard 1 card, and if you do, Special Summon 1 "Impcantation" monster from your Deck, also, during the End Phase, lose 2500 LP if you did not Special Summon a Ritual Monster this turn after you resolved this effect. You can send 1 "Impcantation" card from your hand or face-up field to the GY, then target 1 monster your opponent controls; destroy it. You can only use 1 "Impcantation Chalislime" effect per turn, and only once that turn.
--魔神儀-カリスライム --Impcantation Chalislime --Scripted by Logical Nonsense local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Special Summon 1 "Impcantation" from deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Destroy 1 monster your opponent controls local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCost(s.descost) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end s.listed_series={SET_IMPCANTATION} s.listed_names={86758915} function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsPublic() end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_IMPCANTATION) 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.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end local c=e:GetHandler() --Check for the Special Summon of a Ritual Monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetOperation(s.regop) e1:SetLabel(1) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --Lose 2500 LP in the End Phase local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetCondition(s.damcon) e2:SetOperation(s.damop) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetLabelObject(e1) Duel.RegisterEffect(e2,tp) end function s.ritfilter(c,tp) return c:IsType(TYPE_RITUAL) and c:IsSummonPlayer(tp) and c:IsFaceup() end function s.regop(e,tp,eg,ep,ev,re,r,rp) if e:GetLabel()==0 then return end if eg and eg:IsExists(s.ritfilter,1,nil,tp) then e:SetLabel(0) end end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetLabelObject():GetLabel()~=0 end function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local lp=Duel.GetLP(tp) Duel.SetLP(tp,lp-2500) end function s.costfilter(c) return c:IsSetCard(SET_IMPCANTATION) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost() end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Destroy 2 monsters on the field.
--使徒喰い虫 --Nobleman-Eater Bug local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) 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) end if chk==0 then return true end if Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,2,2,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if not g then return end local sg=g:Filter(Card.IsRelateToEffect,nil,e) if #sg~=2 then return end Duel.Destroy(g,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 4 DARK monsters Once per turn (Quick Effect): You can detach 1 material from this card; this face-up card is unaffected by other monster effects this turn.
--ヴェルズ・タナトス --Evilswarm Thanatos local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Xyz summon procedure Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),4,2) --Make itself unaffected by monster effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) c:RegisterEffect(e1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then --Unaffected by monster effects local e1=Effect.CreateEffect(c) e1:SetDescription(3101) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(s.efilter) c:RegisterEffect(e1) end end function s.efilter(e,te) return te:IsActiveType(TYPE_EFFECT) and te:GetOwner()~=e:GetOwner() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While this card is face-up in the Spell & Trap Zone, Warrior monsters you control gain 500 ATK/DEF. Once per turn: You can discard 1 card; Special Summon this card as an Effect Monster (Warrior/LIGHT/Level 4/ATK 2000/DEF 2000) with the following effect (this card is also still a Trap), then you can add 1 "Argostars" card from your Deck to your hand, except "Argostars - Lightning Tydeu". ● Once per turn (Quick Effect): You can place this card face-up in your Spell & Trap Zone.
--ARG☆S-紫電のテュデル --Argostars - Lightning Tydeu --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) c:RegisterEffect(e0) --Warrior monsters you control gain 500 ATK/DEF local e1a=Effect.CreateEffect(c) e1a:SetType(EFFECT_TYPE_FIELD) e1a:SetCode(EFFECT_UPDATE_ATTACK) e1a:SetRange(LOCATION_SZONE) e1a:SetTargetRange(LOCATION_MZONE,0) e1a:SetTarget(function(e,c) return c:IsRace(RACE_WARRIOR) end) e1a:SetValue(500) c:RegisterEffect(e1a) local e1b=e1a:Clone() e1b:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e1b) --Special Summon this card as an Effect Monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_ARGOSTARS} function s.spcost(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.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:HasFlagEffect(id) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,2000,2000,4,RACE_WARRIOR,ATTRIBUTE_LIGHT) end c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END&~(RESET_TOFIELD|RESET_LEAVE|RESET_TURN_SET),0,1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thfilter(c) return c:IsSetCard(SET_ARGOSTARS) and not c:IsCode(id) and c:IsAbleToHand() end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,2000,2000,4,RACE_WARRIOR,ATTRIBUTE_LIGHT)) then return end c:AddMonsterAttribute(TYPE_EFFECT|TYPE_TRAP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) --You can place this card in your Spell & Trap Zone face-up local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.pltg) e1:SetOperation(s.plop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) c:AddMonsterAttributeComplete() if Duel.SpecialSummonComplete()<1 then return end --You can add 1 "ARG☆S" card, except "ARG☆S - Tydel the Purple Lightning", from your Deck to your hand local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) if #sg>0 then Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end end function s.plop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned: You can discard 1 card, then target 1 card on the field; return it to the hand. If this card is Special Summoned from the GY: You can discard 1 card, then target 1 card on the field; return it to the hand. You can only use each effect of "Brionac, the Magical Ice Dragon" once per turn.
--氷魔龍 ブリューナク --Brionac, the Magical Ice Dragon --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) --Return 1 card on the field to the hand (Synchro Summon) 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+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Return 1 card on the field to the hand (Special Summon from the GY) local e2=e1:Clone() e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():IsSummonLocation(LOCATION_GRAVE) end) c:RegisterEffect(e2) end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD,nil) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 3 monsters You can detach 1 material from this card; add 1 "Gold Pride" Spell from your Deck to your hand, then if your LP are lower than your opponent's, you can send 1 "Gold Pride" monster from your Deck to the GY. You can only use the previous effect of "Gold Pride - Chariot Carrie" 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 - Captain Carrie" from your Deck or GY.
--GP-チャリオット・キャリー号 --Gold Pride - Chariot Carrie --scripted by fiftyfour local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure Xyz.AddProcedure(c,nil,3,2) --Search 1 "Gold Pride" Spell local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Return itself to the Extra Deck and Special Summon "Gold Pride - Captain Carrie" 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={96305350} --Gold Pride - Captain Carrie s.listed_series={SET_GOLD_PRIDE} function s.thfilter(c) return c:IsSetCard(SET_GOLD_PRIDE) and c:IsSpell() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) --Register that this effect was activated this turn e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_OATH,1) end function s.tgfilter(c) return c:IsMonster() and c:IsSetCard(SET_GOLD_PRIDE) and c:IsAbleToGrave() end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local thc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if not (thc and Duel.SendtoHand(thc,nil,REASON_EFFECT)>0 and thc:IsLocation(LOCATION_HAND)) then return end Duel.ConfirmCards(1-tp,thc) local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil) if Duel.GetLP(tp)<Duel.GetLP(1-tp) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local gyg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #gyg>0 then Duel.BreakEffect() Duel.SendtoGrave(gyg,REASON_EFFECT) end 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(96305350) 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:
You can target 1 Fish monster you control and 1 monster your opponent controls; banish both monsters until your next Standby Phase. If a Fish monster(s) is Special Summoned to your field while any card is banished: You can banish this card from your GY or your face-up Spell & Trap Zone; all Fish monsters you currently control gain 100 ATK for each currently banished card, until the end of this turn. You can only use each effect of "Ghoti Fury" once per turn.
--ゴーティス・フューリー --Ghoti Fury --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Banish monsters local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) --Increase ATK of Fish monsters local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_GRAVE|LOCATION_SZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.atkcon) e3:SetCost(s.atkcost) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end function s.rmfilter(c,e,tp) return c:IsCanBeEffectTarget(e) and c:IsAbleToRemove() and (c:IsControler(1-tp) or (c:IsFaceup() and c:IsRace(RACE_FISH))) end function s.rmrescon(sg,e,tp,mg) return sg:FilterCount(Card.IsControler,nil,tp)==1 end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rmrescon,0) end local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rmrescon,1,tp,HINTMSG_REMOVE) Duel.SetTargetCard(dg) Duel.SetOperationInfo(0,CATEGORY_REMOVE,dg,#dg,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg~=2 then return end local reset_count=(Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_STANDBY)) and 2 or 1 local turn_chk=Duel.GetTurnCount() aux.RemoveUntil(tg,nil,REASON_EFFECT,PHASE_STANDBY,id,e,tp, aux.DefaultFieldReturnOp, function() return Duel.IsTurnPlayer(tp) and (reset_count==1 or Duel.GetTurnCount()~=turn_chk) end, RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,reset_count) end function s.atkfilter(c,tp) return c:IsFaceup() and c:IsRace(RACE_FISH) and c:IsControler(tp) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.atkfilter,1,nil,tp) and Duel.GetFieldGroupCount(0,LOCATION_REMOVED,LOCATION_REMOVED)>0 end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_GRAVE) or c:IsStatus(STATUS_EFFECT_ENABLED)) end Duel.Remove(c,POS_FACEUP,REASON_COST) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil,tp) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil,tp) if #g==0 then return end local ct=Duel.GetFieldGroupCount(0,LOCATION_REMOVED,LOCATION_REMOVED) if ct==0 then return end local atk=ct*100 local c=e:GetHandler() for tc in g:Iter() do --Gain ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(atk) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control an Insect monster: You can Special Summon this card from your hand. During your Main Phase: You can inflict 200 damage to your opponent for each "Battlewasp - Pin the Bullseye" you control. You can only use each effect of "Battlewasp - Pin the Bullseye" once per turn.
--B・F-必中のピン --Battlewasp - Pin the Bullseye --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_INSECT),tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end s.damfilter=aux.FaceupFilter(Card.IsCode,id) function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.damfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.SetTargetPlayer(1-tp) local dam=Duel.GetMatchingGroupCount(s.damfilter,tp,LOCATION_MZONE,0,nil)*200 Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local dam=Duel.GetMatchingGroupCount(s.damfilter,tp,LOCATION_MZONE,0,nil)*200 Duel.Damage(p,dam,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned: You can banish 1 Level 6 or lower Fish monster from your Deck. If this card is sent to the GY as Synchro Material: You can target 1 Fish monster in your GY; banish that target, then you can add 1 Fish monster with an equal or lower Level from your Deck to your hand. You can only use each effect of "Arionpos, Serpent of the Ghoti" once per turn.
--ゴーティスの大蛇アリオンポス --Arionpos, Serpent of the Ghoti --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Synchro Summon procedure: 1 Tuner + 1+ Non-Tuner monsters Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --If Synchro Summoned, banish 1 Fish monster from the Deck 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_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end) e1:SetTarget(s.rmvtg) e1:SetOperation(s.rmvop) c:RegisterEffect(e1) --If sent to the GY as material, banish 1 Fish monster from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcond) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end function s.rmvfilter(c) return c:IsRace(RACE_FISH) and c:IsLevelBelow(6) and c:IsAbleToRemove() end function s.rmvtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmvfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) end function s.rmvop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmvfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end function s.thcond(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and r&REASON_SYNCHRO>0 end function s.tgtfilter(c) return c:IsRace(RACE_FISH) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and chkc:IsControler(tp) and s.tgtfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.tgtfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.tgtfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thfilter(c,lv) return c:IsRace(RACE_FISH) and c:IsLevelBelow(lv) and c:IsAbleToHand() end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsRace(RACE_FISH) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,tc:GetLevel()) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel()) if #g>0 then Duel.BreakEffect() Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Banish 5 face-up Pendulum Monsters from your Extra Deck; place 1 Pendulum Monster from your Deck or face-up Extra Deck in your Pendulum Zone. You can banish this card from your GY, then target 1 card in any Pendulum Zone; reduce its Pendulum Scale by 1 (min. 0). You can only activate 1 "Pendulum Pendant" per turn.
--ペンデュラム・ペンダント --Pendulum Pendant --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Place 1 Pendulum monster in the Pendulum Zone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_LIMIT_ZONE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetValue(s.zones) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Reduce a Pendulum Scale by 1 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.scltg) e2:SetOperation(s.sclop) c:RegisterEffect(e2) end function s.zones(e,tp,eg,ep,ev,re,r,rp) local zone=0xff --all Spell/Trap zones if Duel.IsDuelType(DUEL_SEPARATE_PZONE) then return zone end local p0=Duel.CheckLocation(tp,LOCATION_PZONE,0) local p1=Duel.CheckLocation(tp,LOCATION_PZONE,1) if p0==p1 then return zone end if p0 then zone=zone-0x1 end --remove the left most S/T zone if p1 then zone=zone-0x10 end --remove the right most S/T zone return zone end function s.costfilter(c) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToRemoveAsCost() end function s.pendfilter(c) return c:IsType(TYPE_PENDULUM) and (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) and not c:IsForbidden() end function s.rescon(pg) return function(sg,e,tp,mg) return #sg==5 and pg:IsExists(aux.TRUE,1,sg) end end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_EXTRA,0,nil) local pg=Duel.GetMatchingGroup(s.pendfilter,tp,LOCATION_EXTRA|LOCATION_DECK,0,nil) if chk==0 then return #g>=5 and aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon(pg),0) end local rg=aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon(pg),1,tp,HINTMSG_REMOVE) Duel.Remove(rg,POS_FACEUP,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) and Duel.IsExistingMatchingCard(s.pendfilter,tp,LOCATION_EXTRA|LOCATION_DECK,0,1,nil) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not Duel.CheckPendulumZones(tp) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local tc=Duel.SelectMatchingCard(tp,s.pendfilter,tp,LOCATION_EXTRA|LOCATION_DECK,0,1,1,nil):GetFirst() if tc then Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end function s.sclfilter(c) return c:GetScale()>0 end function s.scltg(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(s.sclfilter,tp,LOCATION_PZONE,LOCATION_PZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.sclfilter,tp,LOCATION_PZONE,LOCATION_PZONE,1,1,nil) end function s.sclop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:GetScale()>0 then --Reduce its scale by 1 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_LSCALE) e1:SetValue(-1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_RSCALE) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When either player draws a Tuner(s) for their normal draw in their Draw Phase: They can reveal that card(s); they draw 2 cards. If your opponent draws by this effect: You lose 2000 LP, and if you do, send this card to the GY.
--綱引犬会 --Don't Slip, the Dogs of War --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) --Draw 2 cards local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_EVENT_PLAYER) e2:SetCode(EVENT_DRAW) e2:SetRange(LOCATION_FZONE) e2:SetCondition(s.drcon) e2:SetCost(s.drcost) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) --Lose 2000 LP and send this card to the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_CUSTOM+id) e3:SetRange(LOCATION_FZONE) e3:SetTarget(s.gytg) e3:SetOperation(s.gyop) c:RegisterEffect(e3) end function s.cfilter(c) return c:IsType(TYPE_TUNER) and not c:IsPublic() end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_RULE and eg:IsExists(s.cfilter,1,nil) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local tg=eg:Filter(s.cfilter,nil) if #tg>1 then tg=tg:Select(tp,1,1,nil) end Duel.ConfirmCards(1-tp,tg) Duel.ShuffleHand(tp) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function s.drop(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) local c=e:GetHandler() if p~=c:GetControler() then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+id,e,0,tp,tp,0) end end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) Duel.SetLP(tp,Duel.GetLP(tp)-2000) Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a monster you control. You can only control 1 "Dunnell, the Noble Arms of Light". The equipped monster gains 500 ATK for each monster you control with a different name that mentions "Adventurer Token". If this card is sent to the GY: You can target 1 "Adventurer Token" you control; equip this card to that target. You can only use this effect of "Dunnell, the Noble Arms of Light" once per turn.
--光の聖剣ダンネル --Dunnell, the Noble Arms of Light --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) aux.AddEquipProcedure(c,0) --Increase ATK by 500 per monster that mentions "Adventurer Token" local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(s.atkval) c:RegisterEffect(e1) --Equip this card to "Adventurer Token" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_EQUIP) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.eqcon) e2:SetTarget(s.eqtg) e2:SetOperation(s.eqop) c:RegisterEffect(e2) end s.listed_names={TOKEN_ADVENTURER} function s.atkfilter(c) return c:IsFaceup() and c:ListsCode(TOKEN_ADVENTURER) end function s.atkval(e,c) return Duel.GetMatchingGroup(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)*500 end function s.eqcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():CheckUniqueOnField(tp) end function s.eqfilter(c) return c:IsFaceup() and c:IsCode(TOKEN_ADVENTURER) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end if chk==0 then return c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsCode(TOKEN_ADVENTURER) and tc:IsControler(tp) and c:CheckUniqueOnField(tp) then Duel.Equip(tp,c,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can make your opponent gain 500 LP, then your opponent looks at the top 3 cards in your Deck, and chooses 1 of them for you to add to your hand, also shuffle the rest back into the Deck. You can only use this effect of "Fairy Tail - Rochka" once per turn. Once per battle, if this card battles, before damage calculation: You can send this card to the GY.
--妖精伝姫-ラチカ --Fairy Tail - Rochka --Scripted by DyXel local s,id=GetID() function s.initial_effect(c) --Opponent looks at top 3 cards of your deck, choose 1 to add to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.exctg) e1:SetOperation(s.excop) c:RegisterEffect(e1) --When battling, send itself to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_CONFIRM) e2:SetCondition(s.sgycon) e2:SetTarget(s.sgytg) e2:SetOperation(s.sgyop) c:RegisterEffect(e2) end function s.posfilter(c) return c:IsFaceup() and c:IsCanTurnSet() end function s.exctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then local g=Duel.GetDecktopGroup(tp,3) return #g>=3 and g:FilterCount(Card.IsAbleToHand,nil)>0 end Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,500) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK) end function s.excop(e,tp,eg,ep,ev,re,r,rp) if Duel.Recover(1-tp,500,REASON_EFFECT)<=0 then return end Duel.BreakEffect() Duel.ConfirmDecktop(tp,3) local g=Duel.GetDecktopGroup(tp,3) if #g>0 then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND) local sc=g:Select(1-tp,1,1,nil):GetFirst() if sc:IsAbleToHand() then Duel.SendtoHand(sc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sc) Duel.ShuffleHand(tp) else Duel.SendtoGrave(sc,REASON_RULE) end Duel.ShuffleDeck(tp) end end function s.sgycon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsRelateToBattle() and bc and bc:IsFaceup() and bc:IsRelateToBattle() end function s.sgytg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToGrave() end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,tp,0) end function s.sgyop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoGrave(c,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Main Phase: Fusion Summon 1 Fiend Fusion Monster from your Extra Deck, by banishing materials mentioned on it from your field or GY. If Fusion Summoning a "Dark World" monster this way, you can also discard monsters as material. During your Main Phase, if this card is in your GY: You can add this card to your hand, then discard 1 "Dark World" monster. You can only use each effect of "Dark World Accession" once per turn.
--暗黒界の登極 --Dark World Accession --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Fusion Summon local e1=Fusion.CreateSummonEff({handler=c,fusfilter=aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),matfilter=s.matfilter,extrafil=s.fextra,extraop=s.extraop,extratg=s.extratg}) e1:SetDescription(aux.Stringid(id,0)) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCondition(function() return Duel.IsMainPhase() end) c:RegisterEffect(e1) --Add this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_HANDES) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_DARK_WORLD} function s.matfilter(c) return (c:IsLocation(LOCATION_HAND) and c:IsDiscardable(REASON_EFFECT+REASON_FUSION+REASON_MATERIAL)) or (c:IsOnField() and c:IsAbleToRemove()) end function s.checkmat(tp,sg,fc) return fc:IsSetCard(SET_DARK_WORLD) or not sg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) end function s.fextra(e,tp,mg) if Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then return nil,s.checkmat end return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil),s.checkmat end function s.extraop(e,tc,tp,sg) local rg=sg:Filter(Card.IsLocation,nil,LOCATION_HAND) if #rg>0 then Duel.SendtoGrave(rg,REASON_DISCARD+REASON_EFFECT+REASON_FUSION+REASON_MATERIAL) sg:Sub(rg) end Fusion.BanishMaterial(e,tc,tp,sg) end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_MZONE|LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.tgfilter(c) return c:IsSetCard(SET_DARK_WORLD) and c:IsMonster() and c:IsDiscardable(REASON_EFFECT) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND)) then return end Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,nil) if #g>0 then Duel.BreakEffect() Duel.SendtoGrave(g,REASON_EFFECT|REASON_DISCARD) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each turn, 1 Level 5 or higher Gemini monster you Normal Summon can be Summoned without Tributing. During your Main Phase, you can Normal Summon 1 Gemini monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.) Once per turn: You can target 1 card your opponent controls; banish 1 Gemini monster you control, that is treated as an Effect Monster and has gained its effects, until your opponent's End Phase, and if you do, destroy that card.
--化合電界 --Catalyst Field local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --1 Level 5 or higher Gemini monster can be Normal Summoned without tribute local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SUMMON_PROC) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_HAND,0) e2:SetCountLimit(1) e2:SetCondition(s.ntcon) e2:SetTarget(aux.FieldSummonProcTg(s.nttg)) c:RegisterEffect(e2) --Can Normal Summon 1 additional Gemini monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e3:SetRange(LOCATION_FZONE) e3:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_GEMINI)) c:RegisterEffect(e3) --Destroy 1 opponent card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_FZONE) e4:SetCountLimit(1) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) end s.listed_card_types={TYPE_GEMINI} function s.ntcon(e,c,minc) if c==nil then return true end return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.nttg(e,c) return c:IsLevelAbove(5) and c:IsType(TYPE_GEMINI) end function s.rmfilter(c) return c:IsGeminiStatus() and c:IsAbleToRemove() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,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_REMOVE,nil,1,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() if not rc then return end local reset=RESET_PHASE|PHASE_END|RESET_OPPO_TURN if aux.RemoveUntil(rc,nil,REASON_EFFECT,PHASE_END,id,e,tp,aux.DefaultFieldReturnOp,s.retcon,reset) then local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end Duel.Destroy(tc,REASON_EFFECT) end end function s.retcon(ag,e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end