instruction
stringclasses
1 value
input
stringlengths
10
1.11k
output
stringlengths
67
7.06k
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a card(s) is sent from your opponent's Deck to the Graveyard by a card effect, inflict 300 damage to your opponent.
--パラライズ・チェーン --Paralyzing Chain local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --discard deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCategory(CATEGORY_DAMAGE) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.damcon) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_DECK) and c:IsPreviousControler(tp) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return re and (r&REASON_EFFECT)~=0 and eg:IsExists(s.cfilter,1,nil,1-tp) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300) end function s.damop(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:
Destroy this card if your opponent activates a card or effect that targets a card(s) in the Graveyard. When this card is destroyed by this effect and sent to the Graveyard, your opponent shuffles all cards in their Graveyard into the Deck.
--急転直下 --Out of the Blue 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) --Self destroy local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_BECOME_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetOperation(s.desop1) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_CHAIN_SOLVED) e3:SetRange(LOCATION_SZONE) e3:SetOperation(s.desop2) c:RegisterEffect(e3) e3:SetLabelObject(e2) --Return cards in the GY to the Deck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(s.retcon) e4:SetTarget(s.rettg) e4:SetOperation(s.retop) c:RegisterEffect(e4) end function s.desop1(e,tp,eg,ep,ev,re,r,rp) if rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not eg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then e:SetLabelObject(nil) else e:SetLabelObject(re) end end function s.desop2(e,tp,eg,ep,ev,re,r,rp) local pe=e:GetLabelObject():GetLabelObject() if pe and pe==re then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end end function s.retcon(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler()==e:GetHandler() end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetFieldGroup(tp,0,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,1-tp,LOCATION_GRAVE) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_GRAVE) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,1-tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Special Summoned: You can banish cards from the top of your opponent's Deck equal to the number of WATER monsters you control. You can target 1 Level 4 or lower WATER monster you control; increase its Level by its original Level. You can banish this card from your GY; 1 WATER monster on the field gains 100 ATK for each currently banished monster, until the end of this turn. You can only use each effect of "Guitar Gurnards Duonigis" once per turn.
--黄紡鮄デュオニギス --Guitar Gurnards Duonigis --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Banish cards from the top of opponent's Deck local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Increase targeted monster's levels local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_LVCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.lvtg) e2:SetOperation(s.lvop) c:RegisterEffect(e2) --Increase targeted monster's ATK local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,2}) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WATER),tp,LOCATION_MZONE,0,nil) if chk==0 then return ct>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=ct and Duel.GetDecktopGroup(1-tp,ct):FilterCount(Card.IsAbleToRemove,nil)==ct end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_DECK) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WATER),tp,LOCATION_MZONE,0,nil) if ct==0 then return end local g=Duel.GetDecktopGroup(1-tp,ct) if #g==ct then Duel.DisableShuffleCheck() Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end function s.lvfilter(c) return c:IsFaceup() and c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then --Increase Level local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(tc:GetOriginalLevel()) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end local atkcfilter=aux.FaceupFilter(Card.IsMonster) local atkfilter=aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WATER) function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(atkcfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(atkcfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil) if ct==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local g=Duel.SelectMatchingCard(tp,atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) if #g>0 then Duel.HintSelection(g,true) --Increase ATK local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*100) e1:SetReset(RESETS_STANDARD_PHASE_END) g:GetFirst():RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
4 Level 2 monsters You can also Xyz Summon this card by using "Number 1: Numeron Gate Ekam" you control as material. (Transfer its materials to this card.) If this card is Xyz Summoned: Banish all monsters on the field. Once per turn, during your next Standby Phase after this card was banished: You can Special Summon this banished card, then if "Numeron Network" is in your Field Zone, inflict damage to your opponent equal to the combined ATK of all banished Xyz Monsters.
--CNo.1 ゲート・オブ・カオス・ヌメロン-シニューニャ --Number C1: Numeron Chaos Gate Sunya --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,2,4,s.ovfilter,aux.Stringid(id,0)) c:EnableReviveLimit() --Banish local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.rmcon) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Special summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_REMOVE) e2:SetOperation(s.op) c:RegisterEffect(e2) end s.xyz_number=1 s.listed_names={15232745,CARD_NUMERON_NETWORK} function s.ovfilter(c,tp,lc) return c:IsFaceup() and c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,15232745) end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end function s.op(e,tp,eg,ep,ev,re,r,rp) local res=(Duel.IsPhase(PHASE_STANDBY) and Duel.IsTurnPlayer(tp)) and 2 or 1 local turn_asc=(Duel.GetCurrentPhase()<PHASE_STANDBY and Duel.IsTurnPlayer(tp)) and 0 or (Duel.IsTurnPlayer(tp)) and 2 or 1 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_REMOVED) e1:SetCountLimit(1) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetLabel(turn_asc+Duel.GetTurnCount()) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,res) e:GetHandler():RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnCount()==e:GetLabel() and Duel.IsTurnPlayer(tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local atk=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsType,TYPE_XYZ),tp,LOCATION_REMOVED,LOCATION_REMOVED,c):GetSum(Card.GetAttack) if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_NUMERON_NETWORK),tp,LOCATION_ONFIELD,0,1,nil) and atk>0 then Duel.BreakEffect() Duel.Damage(1-tp,atk,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Dracotail" monster + 1 monster in the hand When you activate a "Dracotail" card or effect (Quick Effect): You can target 1 card your opponent controls; destroy it. If 2 or more monsters are sent to the GY at the same time, while this card is in your GY (except during the Damage Step): You can Special Summon this card, but banish it when it leaves the field. You can only use each effect of "Dracotail Gulamel" once per turn.
--星辰法宮グラメル --Dracotail Gulamel --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials: 1 "Dragontail" monster + 1 monster in the hand Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DRACOTAIL),aux.FilterBoolFunctionEx(Card.IsLocation,LOCATION_HAND)) --Destroy 1 card your opponent controls local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Special Summon this card from the GY, but banish it when it leaves the field local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e2:SetCode(EVENT_CUSTOM+id) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Keep track of monsters being sent to the GY at the same time local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_GRAVE) e3:SetCondition(function() return not Duel.IsPhase(PHASE_DAMAGE) end) e3:SetOperation(s.regop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_CHAINING) e4:SetOperation(function(e) e:GetHandler():ResetFlagEffect(id+1) end) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EVENT_CHAIN_SOLVED) c:RegisterEffect(e5) local e6=e4:Clone() e6:SetCode(EVENT_BREAK_EFFECT) c:RegisterEffect(e6) end s.listed_series={SET_DRACOTAIL} function s.descon(e,tp,eg,ep,ev,re,r,rp) if rp==1-tp then return false end local trig_p,setcodes=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_SETCODES) if trig_p==1-tp then return false end for _,archetype in ipairs(setcodes) do if ((SET_DRACOTAIL&0xfff)==(archetype&0xfff) and (archetype&SET_DRACOTAIL)==SET_DRACOTAIL) then return true end end end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ct=eg:FilterCount(Card.IsMonster,nil) if ct==0 or eg:IsContains(c) then return end if ct>=2 or c:HasFlagEffect(id+1) then Duel.RaiseSingleEvent(c,EVENT_CUSTOM+id,re,r,rp,ep,ev) end local eff=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT) if eff then c:RegisterFlagEffect(id+1,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) end 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 when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Special Summoned while you control a "Melodious" monster: You can add 1 "Polymerization" from your Deck or GY to your hand. If this card is sent to the GY as Fusion Material for a Fusion Summon: You can target 1 "Melodious" monster you control; it loses exactly 500 ATK, and if it does, inflict 500 damage to your opponent. * The above text is unofficial and describes the card's functionality in the OCG.
--幻奏の音女タムタム --Tamtam the Melodious Diva local s,id=GetID() function s.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BE_MATERIAL) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCondition(s.damcon) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) end s.listed_series={SET_MELODIOUS} s.listed_names={CARD_POLYMERIZATION} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_MELODIOUS) 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:IsCode(CARD_POLYMERIZATION) 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 function s.damcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_FUSION and e:GetHandler():IsLocation(LOCATION_GRAVE) end function s.damfilter(c) return s.cfilter(c) and c:IsAttackAbove(500) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.damfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.damfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.damfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) and tc:IsAttackAbove(500) and tc:UpdateAttack(-500,RESET_EVENT|RESETS_STANDARD,e:GetHandler())==-500 then Duel.Damage(1-tp,500,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster effect is activated, if you have no monsters in your GY: Negate the activation, then if you control "Madolche Puddingcess", shuffle 1 random card from your opponent's hand into the Deck.
--魔導人形の夜 --Madolche Nights local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={74641045} function s.condition(e,tp,eg,ep,ev,re,r,rp) return re:IsMonsterEffect() and Duel.IsChainNegatable(ev) and not Duel.IsExistingMatchingCard(Card.IsMonster,tp,LOCATION_GRAVE,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function s.cfilter(c) return c:IsFaceup() and c:IsCode(74641045) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Discard 1 card, then target 1 monster on the field; destroy it.
--死者への手向け --Tribute to The Doomed local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) 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 Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.activate(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:
If your LP is 3000 or less: Pay 1000 LP, then target 1 Normal Trap in your GY, except "Trap of Darkness"; this card's effect becomes that target's activated effect, then banish that target.
--闇よりの罠 --Trap of Darkness local s,id=GetID() function s.initial_effect(c) --copy trap local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DRAW_PHASE|TIMINGS_CHECK_MONSTER_E,TIMING_DRAW_PHASE|TIMINGS_CHECK_MONSTER_E) e1:SetCondition(s.condition) e1:SetCost(Cost.PayLP(1000)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={id} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetLP(tp)<=3000 end function s.filter(c) return c:IsNormalTrap() and not c:IsCode(id) and c:IsAbleToRemove() and c:CheckActivateEffect(false,true,false)~=nil end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then local te=e:GetLabelObject() local tg=te:GetTarget() return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end e:SetProperty(EFFECT_FLAG_CARD_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) Duel.ClearTargetCard() g:GetFirst():CreateEffectRelation(e) local tg=te:GetTarget() e:SetProperty(te:GetProperty()) if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end te:SetLabelObject(e:GetLabelObject()) e:SetLabelObject(te) Duel.ClearOperationInfo(0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local te=e:GetLabelObject() if not te then return end if not te:GetHandler():IsRelateToEffect(e) then return end e:SetLabelObject(te:GetLabelObject()) local op=te:GetOperation() if op then op(e,tp,eg,ep,ev,re,r,rp) end Duel.Remove(te:GetHandler(),POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Therion" monster in your GY; Special Summon it, then you can equip 1 "Therion" monster from your hand or GY to it. During the Main Phase: You can banish this card from your GY, then target 2 "Therion" monsters (1 on your field and 1 in your GY); equip that monster from your GY to the other monster you control. You can only use 1 "Therion Stand Up!" effect per turn, and only once that turn.
--セリオンズ・スタンダップ --Therion Stand Up! --Scripted by Eerie Code 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+CATEGORY_EQUIP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Equip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) e2:SetCountLimit(1,id) e2:SetCondition(function() return Duel.IsMainPhase() end) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.eqtg) e2:SetOperation(s.eqop) c:RegisterEffect(e2) end s.listed_series={SET_THERION} function s.spfilter(c,e,tp) return c:IsSetCard(SET_THERION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.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.eqfilter(c) return c:IsSetCard(SET_THERION) and c:IsMonster() and not c:IsForbidden() end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then local eg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,nil) if #eg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=eg:Select(tp,1,1,nil):GetFirst() if Duel.Equip(tp,ec,tc) then --Equip limit local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(s.eqlimit) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetLabelObject(tc) ec:RegisterEffect(e1) end end end end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local f1=aux.FaceupFilter(Card.IsSetCard,SET_THERION) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end if chk==0 then return ft>0 and Duel.IsExistingTarget(f1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,f1,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local ec=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,ec,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,ec,1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end local g=Duel.GetTargetCards(e) if #g<2 then return end local tc=g:GetFirst() local oc=g:GetNext() if oc==e:GetLabelObject() then tc,oc=oc,tc end if not (tc:IsFaceup() and tc:IsControler(tp)) then return end if Duel.Equip(tp,oc,tc) then --Equip limit local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(s.eqlimit) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetLabelObject(tc) oc:RegisterEffect(e1) end end function s.eqlimit(e,c) return c==e:GetLabelObject() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each "Performapal" and "Performage" monster you control cannot be destroyed by battle or card effect once per turn. You take no battle damage from attacks involving "Performapal" and "Performage" monsters you control.
--バリア・バブル --Bubble Barrier 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) --avoid battle damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(s.target) e2:SetValue(1) c:RegisterEffect(e2) --indes local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(s.target) e3:SetValue(s.indct) c:RegisterEffect(e3) end s.listed_series={SET_PERFORMAGE,SET_PERFORMAPAL} function s.target(e,c) return c:IsSetCard({SET_PERFORMAGE,SET_PERFORMAPAL}) end function s.indct(e,re,r,rp) if (r&REASON_BATTLE+REASON_EFFECT)~=0 then return 1 else return 0 end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card, then target 2 of your banished Zombie monsters, except "Shiranui Spectralsword Shade", including a "Shiranui" monster; Special Summon them in Defense Position, but negate their effects, also, you cannot Special Summon monsters for the rest of this turn, except Zombie monsters. You can only use this effect of "Shiranui Spectralsword Shade" once per turn.
--逢魔ノ妖刀-不知火 --Shiranui Spectralsword Shade --Scripted by AlphaKretin and ahtelel local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={id} s.listed_series={SET_SHIRANUI} function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(Card.IsSetCard,1,nil,SET_SHIRANUI) end function s.filter(c,e,tp) return c:IsRace(RACE_ZOMBIE) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_REMOVED,0,nil,e,tp) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and aux.SelectUnselectGroup(g,1,tp,2,2,s.rescon,chk) end local tg=aux.SelectUnselectGroup(g,1,tp,2,2,s.rescon,chk,tp) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,#tg,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,1)) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) if #sg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end local tc=sg:GetFirst() for tc in aux.Next(sg) do if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2,true) end end Duel.SpecialSummonComplete() end function s.splimit(e,c,tp,sumtp,sumpos) return not c:IsRace(RACE_ZOMBIE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the turn this card was Normal Summoned, you can Normal Summon 1 "lswarm" monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.)
--ヴェルズ・カストル --Evilswarm Castor local s,id=GetID() function s.initial_effect(c) --extra summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetOperation(s.sumop) c:RegisterEffect(e1) end s.listed_series={SET_LSWARM} function s.sumop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFlagEffect(tp,id)~=0 then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetDescription(aux.Stringid(id,0)) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_LSWARM)) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be destroyed by monster effects. You can only use each of the following effects of "Shining Sarcophagus" once per turn. During your Main Phase: You can add 1 card that mentions "Shining Sarcophagus" from your Deck to your hand, except "Shining Sarcophagus". If your opponent Special Summons a monster(s) from the GY (except during the Damage Step): You can discard 1 Spell, then target 1 of those monsters; send it to the GY.
--光の黄金櫃 --Shining Sarcophagus --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Cannot be destroyed by monster effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetRange(LOCATION_SZONE) e2:SetValue(function(_,re) return re:IsMonsterEffect() end) c:RegisterEffect(e2) --Search 1 card that mentions "Shining Sarcophagus" 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_SZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) --Send 1 monster back 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:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e4:SetCode(EVENT_CUSTOM+id) e4:SetRange(LOCATION_SZONE) e4:SetCountLimit(1,{id,1}) e4:SetCondition(function() return Duel.GetCurrentPhase()~=PHASE_DAMAGE end) e4:SetCost(s.tgcost) e4:SetTarget(s.tgtg) e4:SetOperation(s.tgop) c:RegisterEffect(e4) local g=Group.CreateGroup() g:KeepAlive() e4:SetLabelObject(g) --Mass register local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetRange(LOCATION_SZONE) e5:SetLabelObject(e4) e5:SetOperation(s.regop) c:RegisterEffect(e5) end s.listed_names={id} function s.thfilter(c) return c:ListsCode(id) and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.tgfilter(c,e,p) return c:IsSummonPlayer(p) and c:IsSummonLocation(LOCATION_GRAVE) and c:IsAbleToGrave() and c:IsLocation(LOCATION_MZONE) and c:IsCanBeEffectTarget(e) end function s.regop(e,tp,eg,ep,ev,re,r,rp) local tg=eg:Filter(s.tgfilter,nil,e,1-tp) if #tg>0 then for tc in tg:Iter() do tc:RegisterFlagEffect(id,RESET_CHAIN,0,1) end local g=e:GetLabelObject():GetLabelObject() if Duel.GetCurrentChain()==0 then g:Clear() end g:Merge(tg) g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil) e:GetLabelObject():SetLabelObject(g) Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0) end end function s.cfilter(c) return c:IsSpell() and c:IsDiscardable() end function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST|REASON_DISCARD) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local g=e:GetLabelObject():Filter(s.tgfilter,nil,e,1-tp) if chkc then return g:IsContains(chkc) and s.tgfilter(chkc,e,1-tp) end if chk==0 then return #g>0 end local tg=g if #g>1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) tg=g:Select(tp,1,1,nil) end Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,1,0,0) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] While you control an "Amorphage" monster, neither player can Tribute monsters, except "Amorphage" monsters. Once per turn, during your Standby Phase, Tribute 1 monster or destroy this card. ---------------------------------------- [ Monster Effect ] If this card is Pendulum Summoned or flipped face-up, neither player can Special Summon monsters from the Extra Deck while this card is face-up on the field, except "Amorphage" monsters.
--アモルファージ・オルガ --Amorphage Wrath local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --flip local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_FLIP) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetOperation(s.flipop) c:RegisterEffect(e1) --maintenance cost local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e2:SetRange(LOCATION_PZONE) e2:SetCountLimit(1) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetCondition(s.descon) e2:SetOperation(s.desop) c:RegisterEffect(e2) --special summon limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,1) e3:SetTarget(s.sumlimit) c:RegisterEffect(e3) --activation limit local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_CANNOT_RELEASE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetRange(LOCATION_PZONE) e4:SetTargetRange(1,1) e4:SetCondition(s.relcon) e4:SetTarget(s.rellimit) c:RegisterEffect(e4) --Lizard check aux.addContinuousLizardCheck(c,LOCATION_MZONE,s.lizfilter,0xff,0xff) end s.listed_series={SET_AMORPHAGE} function s.flipop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.HintSelection(Group.FromCards(c),true) if Duel.CheckReleaseGroup(tp,Card.IsReleasableByEffect,1,c) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then local g=Duel.SelectReleaseGroup(tp,Card.IsReleasableByEffect,1,1,c) Duel.Release(g,REASON_COST) else Duel.Destroy(c,REASON_COST) end end function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(SET_AMORPHAGE) and (e:GetHandler():IsPendulumSummoned() or e:GetHandler():GetFlagEffect(id)~=0) end function s.relcon(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_AMORPHAGE),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.rellimit(e,c,tp,sumtp) return not c:IsSetCard(SET_AMORPHAGE) end function s.lizfilter(e,c) return not c:IsOriginalSetCard(SET_AMORPHAGE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during your Main Phase 1, you can select 1 face-up Synchro Monster you control. Remove that face-up Synchro Monster you control from play and inflict 600 damage to your opponent. If you use this effect, during your next Standby Phase the removed from play monster returns to the field.
--シンクロ・ガンナー --Synchro Soldier local s,id=GetID() function s.initial_effect(c) --remove local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and 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_REMOVE) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,0,REASON_EFFECT|REASON_TEMPORARY)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetReset(RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN) e1:SetLabelObject(tc) e1:SetCountLimit(1) e1:SetCondition(s.retcon) e1:SetOperation(s.retop) Duel.RegisterEffect(e1,tp) Duel.Damage(1-tp,600,REASON_EFFECT) end end function s.retcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.retop(e,tp,eg,ep,ev,re,r,rp) Duel.ReturnToField(e:GetLabelObject()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
There can only be 1 "Earthbound Immortal" monster on the field. If there is no face-up Field Spell on the field, destroy this card. Your opponent's monsters cannot target this card for attacks. This card can attack your opponent directly. If this card is destroyed by a card effect, except by its own effect: Destroy all cards on the field.
--地縛神 Ccarayhua --Earthbound Immortal Ccarayhua local s,id=GetID() function s.initial_effect(c) --There can only be 1 "Earthbound Immortal" on the field c:SetUniqueOnField(1,1,aux.FilterBoolFunction(Card.IsSetCard,SET_EARTHBOUND_IMMORTAL),LOCATION_MZONE) --Destroy it if no face-up Field Spell is on the field local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_SELF_DESTROY) e1:SetCondition(s.sdcon) c:RegisterEffect(e1) --Cannot be targeted for attacks local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetValue(aux.imval2) c:RegisterEffect(e2) --Can attack directly local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e3) --Destroy all cards on the field local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_DESTROYED) e4:SetCondition(s.descon) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) end s.listed_series={SET_EARTHBOUND_IMMORTAL} function s.sdcon(e) local c=e:GetHandler() if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end return not Duel.IsExistingMatchingCard(Card.IsFaceup,0,LOCATION_FZONE,LOCATION_FZONE,1,nil) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return not c:IsReason(REASON_BATTLE) and re and re:GetOwner()~=c end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the GY: Add 1 "Blue-Eyes White Dragon" from your Deck to your hand.
--伝説の白石 --The White Stone of Legend local s,id=GetID() function s.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={CARD_BLUEEYES_W_DRAGON} function s.filter(c) return c:IsCode(CARD_BLUEEYES_W_DRAGON) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tc=Duel.GetFirstMatchingCard(s.filter,tp,LOCATION_DECK,0,nil) if tc~=nil 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:
Add 1 Level 5 or higher Normal Monster from your Deck to your hand.
--召喚師のスキル --Summoner's Art local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return c:GetLevel()>=5 and c:IsType(TYPE_NORMAL) 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.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once during this turn, if you would Tribute a monster for a Tribute Summon, you can Tribute 1 monster your opponent controls even though you do not control it. You can only activate 1 "The Monarchs Stormforth" per turn. During the turn you activate this card, you cannot Special Summon monsters from the Extra Deck.
--帝王の烈旋 --The Monarchs Stormforth local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCost(s.cost) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return not c:IsSummonLocation(LOCATION_EXTRA) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) --lizard check aux.addTempLizardCheck(e:GetHandler(),tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH) e2:SetDescription(aux.Stringid(id,1)) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsLocation(LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_EXTRA_RELEASE_SUM) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetCountLimit(1) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by controlling no cards, and cannot be Special Summoned by other ways. You cannot conduct your Battle Phase the turn you Special Summon this card. You cannot activate cards or effects, or Set any cards. During each of your Standby Phases, destroy this card unless you send your entire hand to the Graveyard (min.1).
--爆走特急ロケット・アロー --Rocket Arrow Express local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Special Summon procedure local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --Special Summoning condition local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e2) --Cannot activate cards or effects local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EFFECT_CANNOT_ACTIVATE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(1,0) e3:SetValue(1) c:RegisterEffect(e3) --Cannot Set cards local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(EFFECT_CANNOT_MSET) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(1,0) e4:SetTarget(aux.TRUE) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_CANNOT_SSET) c:RegisterEffect(e5) local e6=e4:Clone() e6:SetCode(EFFECT_CANNOT_TURN_SET) c:RegisterEffect(e6) local e7=e4:Clone() e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e7:SetTarget(function(_,_,_,_,sumpos) return (sumpos&POS_FACEDOWN)>0 end) c:RegisterEffect(e7) --Maintenance cost local e8=Effect.CreateEffect(c) e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e8:SetCode(EVENT_PHASE|PHASE_STANDBY) e8:SetRange(LOCATION_MZONE) e8:SetCountLimit(1) e8:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end) e8:SetOperation(s.mtop) c:RegisterEffect(e8) --Check/apply Battle Phase restriction local e9=Effect.CreateEffect(c) e9:SetType(EFFECT_TYPE_SINGLE) e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e9:SetCode(EFFECT_SPSUMMON_COST) e9:SetCost(function(_,_,tp) return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 end) e9:SetOperation(s.spcostop) c:RegisterEffect(e9) end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0) if #hg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.SendtoGrave(hg,REASON_COST) else Duel.Destroy(e:GetHandler(),REASON_COST) end end function s.spcostop(e,tp,eg,ep,ev,re,r,rp) --Cannot conduct your Battle Phase 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_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_BP) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon this card in Defense Position as an Effect Monster (Zombie/DARK/Level 4/ATK 1800/DEF 500). (This card is also still a Trap.) If this card Summoned this way is destroyed by battle: Inflict damage to your opponent equal to the ATK of the monster that destroyed it.
--死霊ゾーマ --Zoma the Spirit local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) 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.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_DEFENSE) c:AddMonsterAttributeComplete() --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_LEAVE_FIELD) e1:SetCondition(s.damcon) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) e1:SetReset(RESET_EVENT|RESETS_CANNOT_ACT&~(RESET_TOGRAVE|RESET_REMOVE)) c:RegisterEffect(e1,true) Duel.SpecialSummonComplete() end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_BATTLE) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local bc=e:GetHandler():GetBattleTarget() local dam=bc:GetAttack() if dam<0 then dam=0 end Duel.SetTargetPlayer(1-tp) 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,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 battles a Warrior-Type monster, during damage calculation: This card gains 2000 ATK and DEF during that damage calculation only.
--サイファー・スカウター --Cipher Soldier local s,id=GetID() function s.initial_effect(c) --atkdef up local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetCondition(s.con) e1:SetOperation(s.op) c:RegisterEffect(e1) end function s.con(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return bc and bc:IsRace(RACE_WARRIOR) end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL) e1:SetValue(2000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as an "Ultimate Crystal" card.) Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by having exactly 7 "Crystal Beast" cards with different names on your field and/or GY. This card cannot activate the following effects the turn it is Special Summoned. (Quick Effect): You can send all "Crystal Beast" monsters you control to the GY; this card gains 1000 ATK for each monster sent to the GY. You can banish all "Crystal Beast" monsters from your GY; shuffle all cards on the field into the Deck. * The above text is unofficial and describes the card's functionality in the OCG.
--究極宝玉神 レインボー・ドラゴン --Rainbow Dragon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Special Summon procedure local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --Special Summon condition local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e2) --Gain 1000 ATK for each "Crystal Beast" monster sent to the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_FREE_CHAIN) e3:SetHintTiming(TIMING_DAMAGE_STEP) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atkcon) e3:SetCost(s.atkcost) e3:SetOperation(s.atkop) c:RegisterEffect(e3) --Shuffle all cards on the field into the Deck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCondition(function(e) return not e:GetHandler():HasFlagEffect(id) end) e4:SetCost(s.tdcost) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) --Register a flag on Special Summon local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetOperation(s.spop) c:RegisterEffect(e5) end s.listed_series={SET_CRYSTAL_BEAST} function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_CRYSTAL_BEAST),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,nil) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetClassCount(Card.GetCode)==7 end function s.spop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~(RESET_TOFIELD|RESET_TURN_SET)|RESET_PHASE|PHASE_END,0,1) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():HasFlagEffect(id) then return false end return aux.StatChangeDamageStepCondition() end function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(SET_CRYSTAL_BEAST) and c:IsAbleToGraveAsCost() end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return #g>0 and not g:IsContains(e:GetHandler()) end Duel.SendtoGrave(g,REASON_COST) e:SetLabel(#g) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then --Increase ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(e:GetLabel()*1000) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.cfilter(c) return c:IsSetCard(SET_CRYSTAL_BEAST) and c:IsMonster() and aux.SpElimFilter(c,true) end function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) local ct=g:FilterCount(Card.IsAbleToRemoveAsCost,nil) if chk==0 then return #g==ct end Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can place 1 "Exosister" card from your hand on the bottom of the Deck; draw 1 card, then if you control "Exosister Sophia", you gain 800 LP. If your opponent moves a card(s) out of either GY (except during the Damage Step): You can Special Summon from your Extra Deck, 1 "Exosister" Xyz Monster using this face-up card you control as material. (This is treated as an Xyz Summon.) You can only use each effect of "Exosister Irene" once per turn.
--エクソシスター・イレーヌ --Exosister Irene --Scripted by Hatter 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+CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(s.drcost) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) --Special Summon Xyz local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_LEAVE_GRAVE) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(_,tp,_,_,_,_,_,rp)return rp==1-tp end) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={5352328} s.listed_series={SET_EXOSISTER} function s.drcostfilter(c) return c:IsSetCard(SET_EXOSISTER) and c:IsAbleToDeckAsCost() end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.drcostfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.drcostfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.ConfirmCards(1-tp,g) Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,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) if Duel.Draw(p,d,REASON_EFFECT)==d and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,5352328),tp,LOCATION_ONFIELD,0,1,nil) then Duel.BreakEffect() Duel.Recover(tp,800,REASON_EFFECT) end end function s.spfilter(c,e,tp,mc) return c:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) and c:IsSetCard(SET_EXOSISTER) and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then local c=e:GetHandler() local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) 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 c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) if #pg>1 or (#pg==1 and not pg:IsContains(c)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst() if sc then local mg=Group.FromCards(c) sc:SetMaterial(mg) Duel.Overlay(sc,mg) if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then sc:CompleteProcedure() end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate this card by paying 800 LP. Once per turn, if a face-up "Yosenju" monster you control returns to the hand (except during the Damage Step): You can target 1 card your opponent controls; return it to the hand. During your End Phase, unless this effect was activated this turn (and was not negated), destroy this card.
--妖仙大旋風 --Yosen Whirlwind local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(Cost.PayLP(800)) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_TO_HAND) e2:SetCountLimit(1) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) --self destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(s.descon) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_series={SET_YOSENJU} function s.cfilter(c,tp) return c:IsSetCard(SET_YOSENJU) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) 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 chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and e:GetHandler():GetFlagEffect(id)==0 end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
3 DARK monsters on the field Gains ATK equal to the total original ATK of all other monsters on the field with a Predator Counter. You can only use each of the following effects of "Predaplant Triphyoverutum" once per turn. ● When your opponent would Special Summon a monster(s) from their Extra Deck while you control this Fusion Summoned card (Quick Effect): You can negate the Summon, and if you do, destroy that monster(s). ● If your opponent controls a monster with a Predator Counter(s): You can Special Summon this card from your GY in Defense Position. * The above text is unofficial and describes the card's functionality in the OCG.
--捕食植物トリフィオヴェルトゥム --Predaplant Triphyoverutum local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMixN(c,true,true,s.ffilter,3) --atk up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) --disable special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_SPSUMMON) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.discon) e2:SetTarget(s.distg) e2:SetOperation(s.disop) 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_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.counter_list={COUNTER_PREDATOR} function s.ffilter(c,fc,sumtype,tp) return c:IsAttribute(ATTRIBUTE_DARK,fc,sumtype,tp) and c:IsOnField() end function s.vfilter(c) return c:IsFaceup() and c:GetCounter(COUNTER_PREDATOR)>0 end function s.atkval(e,c) local g=Duel.GetMatchingGroup(s.vfilter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c) return g:GetSum(Card.GetBaseAttack) end function s.disfilter(c) return c:GetSummonLocation()==LOCATION_EXTRA end function s.discon(e,tp,eg,ep,ev,re,r,rp) return tp~=ep and Duel.GetCurrentChain()==0 and eg:IsExists(s.disfilter,1,nil) and e:GetHandler():IsFusionSummoned() end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=eg:Filter(Card.IsPreviousLocation,nil,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(Card.IsPreviousLocation,nil,LOCATION_EXTRA) Duel.NegateSummon(g) Duel.Destroy(g,REASON_EFFECT) end function s.cfilter(c) return c:IsFaceup() and c:GetCounter(COUNTER_PREDATOR)>0 end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can send 1 "Battlin' Boxer" monster from your Deck to the GY. The first time this Attack Position card would be destroyed by battle each turn, it is not destroyed.
--BK ヘッドギア --Battlin' Boxer Headgeared local s,id=GetID() function s.initial_effect(c) --send to grave local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) -- local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetCountLimit(1) e1:SetValue(s.valcon) c:RegisterEffect(e1) end s.listed_series={SET_BATTLIN_BOXER} function s.tgfilter(c) return c:IsMonster() and c:IsSetCard(SET_BATTLIN_BOXER) and c:IsAbleToGrave() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function s.valcon(e,re,r,rp) return e:GetHandler():IsAttackPos() and (r&REASON_BATTLE)~=0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card's activation and effect cannot be negated. If you control a monster whose original name is "Obelisk the Tormentor": Negate the effects of 1 Effect Monster your opponent controls, and if you do, destroy it, and if you do that, for the rest of this turn, the effects of that monster are negated, as well as the activated effects and effects on the field of monsters with the same original name, then, if you activated this card during your Main Phase, you can apply this effect. ● Destroy all Spells and Traps your opponent controls. You can only activate 1 "Fist of Fate" per turn.
--ゴッド・ハンド・クラッシャー --Fist of Fate --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={CARD_OBELISK} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsOriginalCodeRule,CARD_OBELISK),tp,LOCATION_MZONE,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local tc=Duel.SelectMatchingCard(tp,Card.IsNegatableMonster,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() if tc then local c=e:GetHandler() --Negate its effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) tc:RegisterEffect(e2) Duel.AdjustInstantly(c) if not tc:IsImmuneToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then --Negate effects of cards with the same original name local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_DISABLE) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e3:SetTarget(s.distg) e3:SetLabel(tc:GetOriginalCodeRule()) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_CHAIN_SOLVING) e4:SetCondition(s.discon) e4:SetOperation(s.disop) e4:SetLabel(tc:GetOriginalCodeRule()) e4:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e4,tp) --Destroy all Spells/Traps the opponent controls local sg=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil) if Duel.IsMainPhase() and Duel.IsTurnPlayer(tp) and #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.Destroy(sg,REASON_EFFECT) end end end end function s.distg(e,c) local code=e:GetLabel() local code1,code2=c:GetOriginalCodeRule() return code1==code or code2==code end function s.discon(e,tp,eg,ep,ev,re,r,rp) local code=e:GetLabel() local code1,code2=re:GetHandler():GetOriginalCodeRule() return re:IsMonsterEffect() and (code1==code or code2==code) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.NegateEffect(ev) 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.
--猛進する剣角獣 --Mad Sword Beast 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:
Cannot attack the turn it is Summoned. If "Toon World" on the field is destroyed, destroy this card. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack your opponent directly. You can Tribute 1 monster; inflict 500 damage to your opponent.
--トゥーン・キャノン・ソルジャー --Toon Cannon Soldier local s,id=GetID() function s.initial_effect(c) --Cannot attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetOperation(s.atklimit) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) --Destroy local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCondition(s.sdescon) e4:SetOperation(s.sdesop) c:RegisterEffect(e4) --Direct attack local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_DIRECT_ATTACK) e5:SetCondition(s.dircon) c:RegisterEffect(e5) --Damage local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,0)) e6:SetCategory(CATEGORY_DAMAGE) e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e6:SetType(EFFECT_TYPE_IGNITION) e6:SetRange(LOCATION_MZONE) e6:SetCost(s.damcost) e6:SetTarget(s.damtg) e6:SetOperation(s.damop) c:RegisterEffect(e6) end s.listed_names={15259703} 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.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.dirfilter1(c) return c:IsFaceup() and c:IsCode(15259703) end function s.dirfilter2(c) return c:IsFaceup() and c:IsType(TYPE_TOON) end function s.dircon(e) return Duel.IsExistingMatchingCard(s.dirfilter1,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) and not Duel.IsExistingMatchingCard(s.dirfilter2,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,nil) end local sg=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,nil) Duel.Release(sg,REASON_COST) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can target 1 Dragon or Machine "Cyber" monster you control; equip this card from your hand or field to it. While this card is an Equip Card, the equipped monster gains 600 ATK. If this card is sent to the GY while equipped to a monster: You can target 1 other Dragon or Machine "Cyber" monster in your GY; Special Summon it. You can only use this effect of "Attachment Cybern" once per turn.
--アタッチメント・サイバーン --Attachment Cybern 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_HAND|LOCATION_MZONE) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --Increase ATK local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(600) c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,id) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_CYBER} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_CYBER) and c:IsRace(RACE_DRAGON|RACE_MACHINE) 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,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_EQUIP,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 Duel.SendtoGrave(c,REASON_RULE) 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) c:RegisterEffect(e1) end function s.eqlimit(e,c) return c:IsSetCard(SET_CYBER) and c:IsRace(RACE_DRAGON|RACE_MACHINE) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_SZONE) and not c:IsReason(REASON_LOST_TARGET) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_CYBER) and c:IsRace(RACE_DRAGON|RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) 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_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) and chkc~=c end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,c,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 you draw this card: You can reveal it; Special Summon it from your hand. If this card is Special Summoned from the hand: You can target 1 of your banished Spellcaster monsters; add it to your hand. You can only use each effect of "Fortune Fairy Hu" once per turn.
--占い魔女 フウちゃん --Fortune Fairy Hu --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_DRAW) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end 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.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND) end function s.thfilter(c) return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,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,tp,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send this card from your hand or field to the GY, then target 1 Dragon monster you control; it gains 500 ATK/DEF until the end of your opponent's turn. If a Normal Monster(s) is sent to your GY, while this card is in the GY (except during the Damage Step): You can Special Summon this card, but banish it when it leaves the field. You can only use this effect of "Guardragon Promineses" once per turn.
--守護竜プロミネシス --Guardragon Promineses --Logical Nonsense local s,id=GetID() function s.initial_effect(c) --1 Dragon you control gains 500 ATK/DEF until the end of your opponent's turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE|LOCATION_HAND) e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.atkdeftg) e1:SetOperation(s.atkdefop) c:RegisterEffect(e1) --Special Summon this card from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.atkdeftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_DRAGON) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_DRAGON),tp,LOCATION_MZONE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_DRAGON),tp,LOCATION_MZONE,0,1,1,nil) end function s.atkdefop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local ct=Duel.IsTurnPlayer(tp) and 2 or 1 --Increase ATK/DEF local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetReset(RESETS_STANDARD_PHASE_END,ct) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsType(TYPE_NORMAL) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.cfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to an opponent's monster. While you control a "Mikanko" monster, take control of that equipped monster. Neither player can activate the effects of the equipped monster while you control it. When this card leaves the field, send the equipped monster to the GY. You can only control 1 "Mikanko Reflection Rondo". You can only activate 1 "Mikanko Reflection Rondo" per turn.
--御巫の誘い輪舞 --Mikanko Reflection Rondo --scripted by Naim local s,id=GetID() function s.initial_effect(c) local e0=aux.AddEquipProcedure(c,1,nil,s.eqlimit) e0:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) --Can only control 1 "Inviting Rondo of the Mikanko" c:SetUniqueOnField(1,0,id) --Gain control of the monster while you control a "Mikanko" monster local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_SET_CONTROL) e1:SetValue(function(e) return e:GetHandlerPlayer() end) e1:SetCondition(s.contcond) c:RegisterEffect(e1) --Equipped monster cannot activate its effect while under your control local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_CANNOT_TRIGGER) e2:SetCondition(s.actcond) c:RegisterEffect(e2) --Send the equiped monster to the GY local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetOperation(s.tgop) c:RegisterEffect(e3) end s.listed_series={SET_MIKANKO} function s.eqlimit(e,c) return e:GetHandler():GetEquipTarget()==c or e:GetHandlerPlayer()~=c:GetControler() end function s.contcond(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MIKANKO),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.actcond(e) local ec=e:GetHandler():GetEquipTarget() return ec:GetControler()==e:GetHandlerPlayer() end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() if ec and ec:IsLocation(LOCATION_MZONE) then Duel.SendtoGrave(ec,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your opponent's Standby Phase: You can have as many monsters they control as possible gain 600 ATK, then destroy as many monsters they control as possible with 2500 or more ATK, and if you do, gain LP equal to the number of monsters destroyed x 500. (The ATK gain remains even if this card leaves the field.) You can only use this effect of "Gingerbread House" once per turn.
--おかしの家 --Gingerbread House --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.desfilter(c) return c:IsFaceup() and c:GetAttack()+600>=2500 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) if #g>0 then local chk=false for tc in aux.Next(g) do if tc:UpdateAttack(600,nil,c)==600 then chk=true end end local dg=g:Filter(Card.IsAttackAbove,nil,2500) if chk and #dg>0 then Duel.BreakEffect() local ct=Duel.Destroy(dg,REASON_EFFECT) if ct>0 then Duel.Recover(tp,ct*500,REASON_EFFECT) end end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Special Summoned: You can Special Summon 1 Level 5 or higher LIGHT monster from your hand, but you lose LP equal to its original ATK, also its ATK becomes doubled until the end of this turn. If this card in the Monster Zone is destroyed: You can banish 1 other Fairy monster from your GY; add 1 Fairy monster with the same Level as that monster from your Deck to your hand. You can only use each effect of "Victorica, Angel of Bravery" once per turn.
--勇気の天使ヴィクトリカ --Victorica, Angel of Bravery --scripted by Rundas local s,id=GetID() function s.initial_effect(c) --SS on SS 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_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.sstg) e1:SetOperation(s.ssop) c:RegisterEffect(e1) --Search on being destroyed 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_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcon) e2:SetCost(s.thcost) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end --SS on SS function s.spfilter(c,e,tp) return c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and 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.ssop(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.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.SetLP(tp,Duel.GetLP(tp)-tc:GetTextAttack()) --Double its ATK local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(tc:GetAttack()*2) tc:RegisterEffect(e1) end end --Search on being destroyed function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function s.remfilter(c,tp) return c:IsRace(RACE_FAIRY) and c:IsAbleToRemoveAsCost() and c:IsMonster() and aux.SpElimFilter(c,true,false) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetLevel()) end function s.thfilter(c,lv) return c:IsRace(RACE_FAIRY) and c:IsAbleToHand() and c:IsMonster() and c:IsLevel(lv) end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.remfilter,tp,LOCATION_GRAVE,0,1,c,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=Duel.SelectMatchingCard(tp,s.remfilter,tp,LOCATION_GRAVE,0,1,1,c,tp):GetFirst() Duel.Remove(tc,POS_FACEUP,REASON_COST) e:SetLabel(tc:GetLevel()) 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) local lv=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can add 1 "Purrely" card from your Deck to your hand, except a Quick-Play Spell. You can target 1 "Purrely" Quick-Play Spell in your GY; Special Summon 1 Xyz Monster from your Extra Deck that mentions that card, by using this card you control as material, and if you do, attach that Spell to the Summoned monster. (This is treated as an Xyz Summon.) You can only use each effect of "Purrelyly" once per turn.
--ピュアリィ・リリィ --Purrelyly --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Search 1 "Purrely" card, except a Quick-Play Spell 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) --Special Summon 1 "Purrely" Xyz monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_LEAVE_GRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_PURRELY} function s.thfilter(c) return c:IsSetCard(SET_PURRELY) and not c:IsQuickPlaySpell() 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.qpfilter(c,e,tp,mc) return c:IsSetCard(SET_PURRELY) and c:IsQuickPlaySpell() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mc,c) end function s.spfilter(c,e,tp,mc,sc) return c:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) and c:ListsCode(sc:GetCode()) and mc:IsCanBeXyzMaterial(c,tp) and sc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingTarget(s.qpfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.qpfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) if #pg>1 or (#pg==1 and not pg:IsContains(c)) then return end local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local xc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,tc):GetFirst() if not xc then return end xc:SetMaterial(c) Duel.Overlay(xc,c) if Duel.SpecialSummon(xc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then xc:CompleteProcedure() Duel.Overlay(xc,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to an "Amazoness" monster. The first time the equipped monster would be destroyed by battle each turn, it is not destroyed. After damage calculation, if the equipped monster attacked a monster: Destroy the attacked monster.
--アマゾネスの秘宝 --Amazoness Heirloom local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,SET_AMAZONESS)) --destroy rep local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e3:SetValue(s.valcon) e3:SetCountLimit(1) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_BATTLED) e4:SetRange(LOCATION_SZONE) e4:SetCondition(s.descon) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) end s.listed_series={SET_AMAZONESS} function s.valcon(e,re,r,rp) return r==REASON_BATTLE end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetEquipTarget()==Duel.GetAttacker() and Duel.GetAttackTarget() 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,Duel.GetAttackTarget(),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetAttackTarget() if tc:IsRelateToBattle() then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during either player's Main Phase: You can target 1 face-up monster on the field; switch its current ATK and DEF until the end of this turn.
--EMウィップ・バイパー --Performapal Whip Snake local s,id=GetID() function s.initial_effect(c) --swap local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCountLimit(1) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return Duel.IsMainPhase() end function s.filter(c) return c:IsFaceup() and c:IsDefenseAbove(0) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and 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.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local atk=tc:GetAttack() local def=tc:GetDefense() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SWAP_ATTACK_FINAL) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(def) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SWAP_DEFENSE_FINAL) e2:SetValue(atk) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 monster you control to the GY, then target 1 of your banished "Six Samurai" monsters; Special Summon it. You can only activate 1 "Secret Skills of the Six Samurai" per turn.
--六武衆の影忍術 --Secret Skills of the Six Samurai 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:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_SIX_SAMURAI} function s.cfilter(c,ft) return c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,ft) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,ft) Duel.SendtoGrave(g,REASON_COST) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_SIX_SAMURAI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and s.filter(chkc,e,tp) end if chk==0 then if e:GetLabel()==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end e:SetLabel(0) return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When another monster you control inflicts battle damage to your opponent: Target 1 face-up monster your opponent controls; it loses ATK equal to the battle damage inflicted.
--幻蝶の刺客アゲハ --Swallowtail Butterspy local s,id=GetID() function s.initial_effect(c) --atk local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atcon) e1:SetTarget(s.attg) e1:SetOperation(s.atop) c:RegisterEffect(e1) end function s.atcon(e,tp,eg,ep,ev,re,r,rp) local rc=eg:GetFirst() return ep~=tp and rc~=e:GetHandler() and rc:IsControler(tp) end function s.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.atop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-ev) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this is the only card in your hand, you can Special Summon it (from your hand). When this card is Summoned: You can draw 2 cards. You must control no other cards and have no cards in your hand to activate and to resolve this effect.
--E・HERO バブルマン --Elemental HERO Bubbleman 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) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e4) end function s.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)==1 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function s.filter(c) return not c:IsStatus(STATUS_LEAVE_CONFIRMED) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,e:GetHandler()) end function s.target(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.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,e:GetHandler()) 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:
3 Level 6 Winged Beast monsters You can also Xyz Summon this card by discarding 1 "Rank-Up-Magic" Spell and using a Rank 5 or lower "Raidraptor" Xyz Monster you control as material. (Transfer its materials to this card.) If this card is Xyz Summoned: You can target 1 monster your opponent controls; destroy it, and if it was face-up, inflict damage to your opponent equal to the ATK it had on the field. If this card in your possession is destroyed by an opponent's card and sent to your GY: You can Special Summon 1 "Raidraptor - Revolution Falcon" from your Extra Deck, and if you do, attach this card to it as material.
--RR-レヴォリューション・ファルコン-エアレイド --Raidraptor - Revolution Falcon - Air Raid local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WINGEDBEAST),6,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop) c:EnableReviveLimit() --atkup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) 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:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_RANK_UP_MAGIC,SET_RAIDRAPTOR} s.listed_names={81927732} function s.cfilter(c) return c:IsSetCard(SET_RANK_UP_MAGIC) and c:IsSpell() and c:IsDiscardable() end function s.ovfilter(c,tp,xyzc) return c:IsFaceup() and c:IsSetCard(SET_RAIDRAPTOR,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsRankBelow(5) end function s.xyzop(e,tp,chk,mc) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local tc=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND,0,nil):SelectUnselect(Group.CreateGroup(),tp,false,Xyz.ProcCancellable) if tc then Duel.SendtoGrave(tc,REASON_DISCARD|REASON_COST) return true else return false end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsXyzSummoned() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) 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) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack()/2) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then local dam=tc:GetAttack() if dam<0 or tc:IsFacedown() then dam=0 end if Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,dam,REASON_EFFECT) end end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousControler(tp) and rp==1-tp and c:IsReason(REASON_DESTROY) end function s.spfilter(c,e,tp) return c:IsCode(81927732) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() 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 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then Duel.Overlay(g:GetFirst(),c) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When an opponent's monster declares an attack on a face-up Attack Position monster you control: Make your opponent's attack a direct attack instead and inflict damage to your opponent equal to the ATK of the attack target you control. Also, that monster you control can attack your opponent directly during your next turn.
--ドゥーブルパッセ --Doble Passe local s,id=GetID() function s.initial_effect(c) --change battle target local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.cbcon) e1:SetTarget(s.cbtg) e1:SetOperation(s.cbop) c:RegisterEffect(e1) end function s.cbcon(e,tp,eg,ep,ev,re,r,rp) local bt=Duel.GetAttackTarget() return bt and bt:IsLocation(LOCATION_MZONE) and bt:IsPosition(POS_FACEUP_ATTACK) and bt:IsControler(tp) end function s.cbtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.GetAttacker():IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK) end end function s.cbop(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttacker() local bt=Duel.GetAttackTarget() if not (bt:IsRelateToBattle() and bt:IsControler(tp)) then return end if at:CanAttack() and not at:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Damage(1-tp,bt:GetAttack(),REASON_EFFECT)>0 then Duel.ChangeAttackTarget(nil) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_SELF_TURN) bt:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned with "Legend of Heart". When this card is Special Summoned: You can target 1 face-up Spell/Trap on the field; banish that target. When this card is targeted for an attack: You can target 1 Spell in your GY; Set that target.
--伝説の騎士 ティマイオス --Legendary Knight Timaeus local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(aux.FALSE) c:RegisterEffect(e1) --remove local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) --set local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BE_BATTLE_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetTarget(s.settg) e3:SetOperation(s.setop) c:RegisterEffect(e3) end function s.rmfilter(c) return c:IsSpellTrap() and c:IsAbleToRemove() and c:IsFaceup() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.rmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.setfilter(c) return c:IsSpell() 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) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then Duel.SSet(tp,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner Dinosaur-Type monsters While this card is face-up on the field, all face-up "Jurrac" monsters you control gain 200 ATK for each "Jurrac" monster in your Graveyard.
--ジュラック・ギガノト --Jurrac Giganoto local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_DINOSAUR),1,99) c:EnableReviveLimit() --Atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_JURRAC)) e1:SetValue(s.val) c:RegisterEffect(e1) end s.listed_series={SET_JURRAC} function s.filter(c) return c:IsSetCard(SET_JURRAC) and c:IsMonster() end function s.val(e,c) return Duel.GetMatchingGroupCount(s.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)*200 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Fusion Summon 1 "Cyberdark Dragon" from your Extra Deck, by shuffling 1 each of "Cyberdark Horn", "Cyberdark Edge", and "Cyberdark Keel" from your hand, field, and/or GY, into the Deck, as Fusion Material.
--サイバーダーク・インパクト! --Cyberdark Impact! local s,id=GetID() function s.initial_effect(c) --Activate local e1=Fusion.CreateSummonEff(c,aux.FilterBoolFunction(Card.IsCode,40418351),Card.IsAbleToDeck,s.fextra,Fusion.ShuffleMaterial,nil,nil,nil,nil,nil,nil,nil,nil,nil,s.extratg) c:RegisterEffect(e1) end s.listed_names={40418351,41230939,77625948,3019642} function s.matfilter(c,lc,stype,tp) return c:IsSummonCode(lc,stype,tp,41230939,77625948,3019642) and c:IsAbleToDeck() end function s.frec(c,tp,sg,g,code,...) if not c:IsSummonCode(fc,SUMMON_TYPE_FUSION,tp,code) then return false end if ... then g:AddCard(c) local res=sg:IsExists(s.frec,1,g,tp,sg,g,...) g:RemoveCard(c) return res else return true end end function s.fcheck(tp,sg,fc,mg) return #sg==3 and sg:IsExists(s.frec,1,nil,tp,sg,Group.CreateGroup(),41230939,77625948,3019642) end function s.fextra(e,tp,mg) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,nil) return g,s.fcheck end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent's LP is at least 1000 higher than yours: Pay 1000 LP; draw 1 card for every 2000 points difference between your LP and your opponent's.
--活路への希望 --Hope for Escape local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetCost(Cost.PayLP(1000)) 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.GetLP(tp)<=Duel.GetLP(1-tp)-1000 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local p1=Duel.GetLP(tp) local p2=Duel.GetLP(1-tp) local s=p2-p1 if s<0 then s=p1-p2 end local d=math.floor(s/2000) Duel.Draw(tp,d,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 Special Summoned: You can target face-up cards your opponent controls, up to the number of Tuners in your GY; negate their effects until the end of this turn. If this Synchro Summoned card is destroyed by card effect and sent to the GY: You can target 1 Tuner in your GY; add it to your hand.
--碧鋼の機竜 --Navy Dragon Mech --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Synchro Summon c:EnableReviveLimit() Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --Negate cards up to the number of tuners local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) 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.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) --Add 1 tuner monster to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsNegatable() end if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_TUNER) end local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_TUNER) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.GetTargetCards(e) if #dg==0 then return end local c=e:GetHandler() for tc in dg:Iter() do if (tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) --Negate its effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) if tc:IsType(TYPE_TRAPMONSTER) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e3) end end end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSynchroSummoned() end function s.thfilter(c) return c:IsType(TYPE_TUNER) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc: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,tp,LOCATION_GRAVE) 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:
Special Summon 1 "Mikanko" monster from your hand or GY, and if you do, equip it with this card, then you can Special Summon 1 monster from your opponent's GY to their field, but negate its effects. The equipped monster cannot be destroyed by card effects. You can only activate 1 "Mikanko Fire Dance" per turn.
--御巫の火叢舞 --Mikanko Fire Dance --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_SPECIAL_SUMMON+CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Prevent destruction by effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetValue(1) c:RegisterEffect(e2) end s.listed_series={SET_MIKANKO} function s.spfilter(c,e,tp) return c:IsSetCard(SET_MIKANKO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0) end function s.spfilter2(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE|LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if not tc then return end local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.Equip(tp,c,tc) then --Add Equip limit local e1=Effect.CreateEffect(tc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(function(e,c) return e:GetOwner()==c end) c:RegisterEffect(e1) --Special Summon 1 monster from the opponent's GY if Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then return end local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter2),tp,0,LOCATION_GRAVE,nil,e,tp) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() if not Duel.SpecialSummonStep(sc,0,tp,1-tp,false,false,POS_FACEUP) then return end --Negate the summoned monster's effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e2,true) end Duel.SpecialSummonComplete() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card; inflict 500 damage to your opponent, and if you do, neither player can activate Trap Cards during the Battle Phase of this turn.
--古代の機械砲台 --Ancient Gear Cannon 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_DAMAGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) c:RegisterEffect(e1) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) if Duel.Damage(1-tp,500,REASON_EFFECT)~=500 then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,1) e1:SetCondition(s.accon) e1:SetValue(s.aclimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.accon(e) return Duel.IsBattlePhase() end function s.aclimit(e,re,tp) return re:GetHandler():IsTrap() and re:IsHasType(EFFECT_TYPE_ACTIVATE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Tuner(s) is sent to your GY, even during the Damage Step: You can Special Summon this card from your GY (if it was there when the card was sent) or hand (even if not) (but banish it when it leaves the field), then if "Junk Warrior" or another monster that mentions it is on the field, you can change all monsters your opponent controls with 1900 or more ATK to Defense Position, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters. You can only use this effect of "Supersonic Chick" once per turn.
--クロスロードランナー --Supersonic Chick --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your GY (if it was there when the card was sent) or hand (even if not) (but banish it when it leaves the field), then if "Junk Warrior" or another monster that mentions it is on the field, you can change all monsters your opponent controls with 1900 or more ATK to Defense Position, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e1:SetCode(EVENT_TO_GRAVE) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_names={CARD_JUNK_WARRIOR} function s.spconfilter(c,tp) return c:IsType(TYPE_TUNER) and c:IsControler(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.spconfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_HAND) or not eg:IsContains(c)) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_POSITION,nil,1,1-tp,LOCATION_MZONE) end function s.posfilter(c) return c:IsAttackAbove(1900) and c:IsAttackPos() and c:IsFaceup() and c:IsCanChangePosition() end function s.junkwarriorfilter(c) return (c:IsCode(CARD_JUNK_WARRIOR) or (c:ListsCode(CARD_JUNK_WARRIOR) and c:IsMonster())) and c:IsFaceup() end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) local g=Duel.GetMatchingGroup(s.posfilter,tp,0,LOCATION_MZONE,nil) if #g>0 and Duel.IsExistingMatchingCard(s.junkwarriorfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.ChangePosition(g,POS_FACEUP_DEFENSE) end end --You cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetTargetRange(1,0) e2:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsSynchroMonster() end) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) --"Clock Lizard" check aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalType(TYPE_SYNCHRO) end) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Possessed Dark Soul" + "Frontier Wiseman" A Fusion Summon of this monster can only be conducted with the above Fusion Material Monsters. When a Normal Spell Card is activated, negate the effect by paying 1000 Life Points. The effect of an Effect Monster that this monster destroys as a result of battle is negated.
--魔人 ダーク・バルター --Dark Balter the Terrible local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,false,false,52860176,38742075) --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.discon) e1:SetCost(Cost.PayLP(1000)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) --disable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BATTLED) e2:SetRange(LOCATION_MZONE) e2:SetOperation(s.disop2) c:RegisterEffect(e2) end function s.discon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetActiveType()==TYPE_SPELL and Duel.IsChainDisablable(ev) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp,chk) Duel.NegateEffect(ev) end function s.disop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() if bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsStatus(STATUS_BATTLE_DESTROYED) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD_EXC_GRAVE) bc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD_EXC_GRAVE) bc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Psychic Synchro Monster + 1 Synchro Monster Must first be Fusion Summoned. Cannot be destroyed by card effects. If this card is Fusion Summoned: You can pay 2000 LP; banish all face-up cards your opponent controls. If this card is in your GY, except the turn it was sent there: You can banish it; Special Summon 1 Level 10 Psychic Fusion Monster from your Extra Deck (this is treated as a Fusion Summon). You can only use this effect of "Absolute Axon Kicker" once per turn.
--アブソリュートサイキッカー --Absolute Axon Kicker --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials: 1 Psychic Synchro Monster + 1 Synchro Monster Fusion.AddProcMix(c,true,true,s.matfilter,aux.FilterBoolFunctionEx(Card.IsType,TYPE_SYNCHRO)) c:AddMustFirstBeFusionSummoned() --Banish all face-up cards your opponent controls 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:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end) e1:SetCost(Cost.PayLP(2000)) e1:SetTarget(s.rmvtg) e1:SetOperation(s.rmvop) c:RegisterEffect(e1) --Cannot be destroyed by card effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetValue(1) c:RegisterEffect(e2) --Special Summon 1 Level 10 Psychic Fusion Monster from your Extra Deck 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_GRAVE) e3:SetCountLimit(1,id) e3:SetCondition(aux.exccon) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.miracle_synchro_fusion=true function s.matfilter(c,fc,sumtype,tp) return c:IsType(TYPE_SYNCHRO,fc,sumtype,tp) and c:IsRace(RACE_PSYCHIC,fc,sumtype,tp) end function s.rmvtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAbleToRemove),tp,0,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD) end function s.rmvop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAbleToRemove),tp,0,LOCATION_ONFIELD,nil) if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end function s.spfilter(c,e,tp) return c:IsLevel(10) and c:IsRace(RACE_PSYCHIC) and c:IsType(TYPE_FUSION) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() if sc then sc:SetMaterial(nil) if Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)>0 then sc:CompleteProcedure() end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can only activate this card while there is a face-up "Elemental HERO Bubbleman" on your side of the field. During this turn, you can activate 1 Trap Card from your hand.
--バブルイリュージョン --Bubble Illusion local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={79979666} function s.filter(c) return c:IsFaceup() and c:IsCode(79979666) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_TRAP_ACT_IN_HAND) e1:SetTargetRange(LOCATION_HAND,0) e1:SetDescription(aux.Stringid(id,0)) e1:SetCountLimit(1,id) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Synchro Summoned. Must be Special Summoned (from your Extra Deck) by sending 2 monsters you control with a Level difference of 7 to the GY (1 Level 8 or higher Tuner and 1 non-Tuner Synchro Monster). If this card is Special Summoned: You can target up to 2 other cards on the field; destroy them. Once per turn, when a card or effect is activated that targets an "Ursarctic" card you control (Quick Effect): You can Tribute 1 monster from your hand or field; negate the activation.
--ベアルクティ-グラン=シャリオ --Ursarctic Grand Chariot local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Must be special summoned by its own method local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --Special summon procedure (from extra deck) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_EXTRA) e2:SetCondition(s.sprcon) e2:SetTarget(s.sprtg) e2:SetOperation(s.sprop) c:RegisterEffect(e2) --Destroy when flipped local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --Negate when effect targets your Ursarctic cards local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_NEGATE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(s.discon) e4:SetCost(aux.CostWithReplace(s.discost,CARD_URSARCTIC_BIG_DIPPER)) e4:SetTarget(s.distg) e4:SetOperation(s.disop) c:RegisterEffect(e4) end s.listed_series={SET_URSARCTIC} function s.sprfilter(c) return c:IsFaceup() and c:IsAbleToGraveAsCost() and c:HasLevel() end function s.sprfilter1(c,tp,g,sc) local lv=c:GetLevel() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) return c:IsType(TYPE_TUNER) and c:IsLevelAbove(8) and g:IsExists(s.sprfilter2,1,c,tp,c,sc) end function s.sprfilter2(c,tp,mc,sc) local sg=Group.FromCards(c,mc) return math.abs(c:GetLevel()-mc:GetLevel())==7 and c:IsType(TYPE_SYNCHRO) and not c:IsType(TYPE_TUNER) and Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0 end function s.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) return g:IsExists(s.sprfilter1,1,nil,tp,g,c) end function s.sprtg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) local g1=g:Filter(s.sprfilter1,nil,tp,g,c) local mg1=aux.SelectUnselectGroup(g1,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true) if #mg1>0 then local mc=mg1:GetFirst() local g2=g:Filter(s.sprfilter2,mc,tp,mc,c,mc:GetLevel()) local mg2=aux.SelectUnselectGroup(g2,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true) mg1:Merge(mg2) end if #mg1==2 then mg1:KeepAlive() e:SetLabelObject(mg1) return true end return false end function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.SendtoGrave(g,REASON_COST) 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_ONFIELD) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end function s.disfilter(c,tp) return c:IsFaceup() and c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp) and c:IsSetCard(SET_URSARCTIC) end function s.discon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(s.disfilter,1,nil,tp) and Duel.IsChainNegatable(ev) end function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,true,nil,nil) end local sg=Duel.SelectReleaseGroupCost(tp,nil,1,1,true,nil,nil) Duel.Release(sg,REASON_COST) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Normal Monsters This card gains these effects based on the number of monsters co-linked to this card. ● 1+: When this card declares an attack on an opponent's monster: You can activate this effect; this card can make a second attack during each Battle Phase this turn, also if this card battles an opponent's monster this turn, that opponent's monster cannot be destroyed by that battle. ● 2: After damage calculation, if this card battled an opponent's monster: You can banish that opponent's monster.
--バイナル・ブレーダー --Binary Blader --Anime version scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Link summon procedure Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_NORMAL),2,2) --Make itself be able to make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1) e1:SetCondition(s.atkcon) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Banish the monster this card battled local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLED) e2:SetCondition(s.rmcon) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetMutualLinkedGroupCount()>=1 end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local d=Duel.GetAttackTarget() if chk==0 then return d and d:IsControler(1-tp) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then --Can make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(3201) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) --Opponent's monsters cannot be destroyed by battle with this card local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetTarget(s.indestg) e2:SetValue(1) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) end end function s.indestg(e,c) return c==e:GetHandler():GetBattleTarget() end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() e:SetLabelObject(bc) return c:GetMutualLinkedGroupCount()>=2 and bc and bc:IsStatus(STATUS_OPPO_BATTLE) and bc:IsRelateToBattle() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetLabelObject():IsAbleToRemove() end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetLabelObject(),1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetLabelObject() if bc:IsRelateToBattle() and bc:IsControler(1-tp) then Duel.Remove(bc,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Banish 1 Normal Trap from your Deck, except "Trap Trick", and if you do, Set 1 card with the same name directly from your Deck. It can be activated this turn. You can only activate 1 Trap Card for the rest of this turn after this card resolves. You can only activate 1 "Trap Trick" per turn.
--トラップトリック --Trap Trick --Scripted by Eerie Code local s, id = GetID() function s.initial_effect(c) --Set 1 Normal Trap Card from the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={id} function s.rmfilter(c,tp) return c:IsNormalTrap() and not c:IsCode(id) and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,c,c:GetCode()) end function s.setfilter(c,code) return c:IsCode(code) and c:IsSSetable() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,rc:GetCode()):GetFirst() if sc and Duel.SSet(tp,sc)>0 then --Can be activated this turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end --Can only activate 1 Trap Card for the rest of this turn local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_CHAINING) e2:SetOperation(s.aclimit1) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_CHAIN_NEGATED) e3:SetOperation(s.aclimit2) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e4:SetCode(EFFECT_CANNOT_ACTIVATE) e4:SetTargetRange(1,0) e4:SetCondition(function(e) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 end) e4:SetValue(function(_,te) return te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:IsTrapEffect() end) e4:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e4,tp) end function s.aclimit1(e,tp,eg,ep,ev,re,r,rp) if not (ep==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect()) then return end Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end function s.aclimit2(e,tp,eg,ep,ev,re,r,rp) if not (ep==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect()) then return end Duel.ResetFlagEffect(tp,id) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Up to twice per turn, you can remove from play 1 Psychic-Type monster from your Graveyard to have this card gain 500 ATK.
--強化人類サイコ --Reinforced Human Psychic Borg local s,id=GetID() function s.initial_effect(c) --atkup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(2) e1:SetCost(s.cost) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsRace(RACE_PSYCHIC) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler()) 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()) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetValue(500) 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:
1 Tuner + 1 or more non-Tuner monsters When this card inflicts Battle Damage to your opponent while they have 4 or more cards in their hand, place 1 random card from their hand on top of their Deck.
--X-セイバー ウルベルム --X-Saber Urbellum local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --handes local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=4 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_HAND) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0) if #g==0 then return end local sg=g:RandomSelect(1-tp,1) Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 7 monsters Once per turn: You can detach 1 material from this card, then target 1 monster your opponent controls; take control of that monster. This card cannot attack the turn this effect is activated.
--No.11 ビッグ・アイ --Number 11: Big Eye local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon: 2 Level 7 monsters Xyz.AddProcedure(c,nil,7,2) --Take control of 1 monster your opponent controls local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.ctrlcost)) e1:SetTarget(s.ctrltg) e1:SetOperation(s.ctrlop) c:RegisterEffect(e1) end s.xyz_number=11 function s.ctrlcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:GetAttackAnnouncedCount()==0 end --This card cannot attack the turn this effect is activated local e1=Effect.CreateEffect(c) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControlerCanBeChanged() end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0) end function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your opponent's turn, Set cards in your Spell & Trap Zones cannot be destroyed by card effects. Each time a Set card(s) in your Spell & Trap Zone is destroyed by an opponent's card effect: This card gains 800 ATK until the end of this turn. * The above text is unofficial and describes the card's functionality in the OCG.
--クマモール --Bearblocker --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_SZONE,0) e1:SetCondition(s.indcon) e1:SetTarget(s.indtg) e1:SetValue(1) c:RegisterEffect(e1) --atk up local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_DESTROYED) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.atkcon) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end function s.indcon(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end function s.indtg(e,c) return c:GetSequence()<5 and c:IsFacedown() end function s.filter(c,tp) return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsPreviousControler(tp) and c:GetPreviousSequence()<5 end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,tp) and rp~=tp end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) e1:SetValue(800) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Altergeist" monster you control; equip this card to it. Your opponent cannot target it for attacks, but it does not prevent your opponent from attacking you directly. Negate an opponent's monster effect that activates by targeting the equipped monster. If an "Altergeist" card(s) you control would be destroyed by battle or card effect, you can banish this card from your GY instead.
--オルターガイスト・カモフラージュ --Altergeist Camouflage local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCost(aux.RemainFieldCost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --destroy replace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTarget(s.reptg) e2:SetValue(s.repval) e2:SetOperation(s.repop) c:RegisterEffect(e2) end s.listed_series={SET_ALTERGEIST} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_ALTERGEIST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,c,tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(s.eqlimit) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET) e2:SetValue(1) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) --negate local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_CHAIN_SOLVING) e4:SetRange(LOCATION_SZONE) e4:SetLabelObject(tc) e4:SetCondition(s.negcon) e4:SetOperation(s.negop) e4:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e4) else c:CancelToGrave(false) end end function s.eqlimit(e,c) return c:GetControler()==e:GetHandlerPlayer() or e:GetHandler():GetEquipTarget()==c end function s.negcon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return rp~=tp and re:IsMonsterEffect() and g and g:IsContains(e:GetLabelObject()) end function s.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end function s.repfilter(c,tp) return c:IsFaceup() and c:IsSetCard(SET_ALTERGEIST) and c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT|REASON_BATTLE) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Dragon Tuner + 1+ non-Tuner Winged Beast monsters Once per turn: You can send up to 3 cards you control to the GY; look at your opponent's Extra Deck, and if you do, send an equal number of cards from there to the GY.
--ドラグニティナイト-トライデント --Dragunity Knight - Trident local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_WINGEDBEAST),1,99) c:EnableReviveLimit() --extra local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.excost) e1:SetOperation(s.exop) c:RegisterEffect(e1) end function s.excost(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA) if ct>3 then ct=3 end if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,ct,nil) Duel.SendtoGrave(g,REASON_COST) e:SetLabel(#g) end function s.exop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local ct=e:GetLabel() if #g<ct then return end Duel.ConfirmCards(tp,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,ct,ct,nil) Duel.SendtoGrave(sg,REASON_EFFECT) Duel.ShuffleExtra(1-tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 monster. Select either its ATK or DEF and gain that many Life Points.
--神秘の中華なべ --Mystik Wok local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) if chk==0 then return true end end function s.costfilter(c) return c:GetAttack()>0 or c:GetDefense()>0 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if e:GetLabel()~=1 then return false end e:SetLabel(0) return Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil) end local sc=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil):GetFirst() local atk=sc:GetAttack() local def=sc:GetDefense() Duel.Release(sc,REASON_COST) local op=nil local b1=atk>0 local b2=def>0 if b1 and b2 then op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,1)}, {b2,aux.Stringid(id,2)}) else op=b1 and 1 or 2 end local val=op==1 and atk or def Duel.SetTargetPlayer(tp) Duel.SetTargetParam(val) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,val) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 Dragon-Type monster; destroy all face-up monsters on the field whose DEF is less than or equal to the ATK the Tributed monster had on the field.
--バーストブレス --Burst Breath 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|TIMINGS_CHECK_MONSTER) e1:SetLabel(1) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c,def) return c:IsRace(RACE_DRAGON) and c:IsAttackAbove(def) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsDefenseBelow,c:GetAttack()),0,LOCATION_MZONE,LOCATION_MZONE,1,c) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g==0 then return false end local mg,mdef=g:GetMinGroup(Card.GetDefense) if chk==0 then e:SetLabel(0) return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,mdef) end local rg=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,mdef) e:SetLabel(rg:GetFirst():GetAttack()) Duel.Release(rg,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetLabel()==0 end local dg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsDefenseBelow,e:GetLabel()),tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsDefenseBelow,e:GetLabel()),tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.Destroy(dg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Discard 2 cards from your hand. Select 1 face-up monster and change it to face-down Defense Position.
--闇の訪れ --Darkness Approaches local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST|REASON_DISCARD) end function s.filter(c) return c:IsFaceup() and c:IsCanTurnSet() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 "Neo-Spacian" monster and 1 "Elemental HERO" monster (1 from your hand and 1 from your Deck) to the GY; Special Summon 1 "Neo-Spacian" monster or 1 Level 5 or higher "Elemental HERO" monster from your Deck, and if you do, add 1 "Polymerization" from your Deck or GY to your hand. If you Special Summoned "Elemental HERO Neos" by this effect, it gains 1000 ATK. You cannot Special Summon monsters from the Extra Deck, except Fusion Monsters, the turn you activate this card. You can only activate 1 "EN - Engage Neo Space" per turn.
--EN-エンゲージ・ネオスペース --EN - Engage Neo Space --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end s.listed_names={CARD_NEOS,CARD_POLYMERIZATION} s.listed_series={SET_ELEMENTAL_HERO,SET_NEO_SPACIAN} function s.counterfilter(c) return c:IsType(TYPE_FUSION) or c:GetSummonLocation()~=LOCATION_EXTRA end function s.cfilter(c) return c:IsMonster() and (c:IsSetCard(SET_NEO_SPACIAN) or c:IsSetCard(SET_ELEMENTAL_HERO)) and c:IsAbleToGraveAsCost() end function s.rescon(sg,e,tp,mg) return sg:GetClassCount(Card.GetLocation)==2 and sg:IsExists(Card.IsSetCard,1,nil,SET_NEO_SPACIAN) and sg:IsExists(Card.IsSetCard,1,nil,SET_ELEMENTAL_HERO) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,sg,e,tp) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,sg,e,tp) end function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsSetCard(SET_NEO_SPACIAN) or (c:IsSetCard(SET_ELEMENTAL_HERO) and c:IsLevelAbove(5))) end function s.thfilter(c) return c:IsCode(CARD_POLYMERIZATION) and c:IsAbleToHand() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND|LOCATION_DECK,0,nil) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 and aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE) Duel.SendtoGrave(g,REASON_COST) local c=e:GetHandler() --Cannot Special Summon from the Extra Deck, except Fusion Monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) --Clock Lizard check aux.addTempLizardCheck(c,tp,s.lizfilter) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) end function s.lizfilter(e,c) return not c:IsOriginalType(TYPE_FUSION) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then if sc:IsCode(CARD_NEOS) then --Increase ATK local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) if #tg>0 then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can add 1 "K9" monster from your Deck to your hand. "K9" monsters you control gain 900 ATK during any turn in which your opponent has activated a monster effect in the hand or GY. If this card in the Spell & Trap Zone is destroyed by card effect: You can Set 1 "K9" Quick-Play Spell from your Deck or GY. You can only use this effect of ""A Case for K9"" once per turn. You can only activate 1 ""A Case for K9"" per turn.
--"Case of K9" --"A Case for K9" --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --When this card is activated: You can add 1 "K9" monster from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetOperation(s.activate) c:RegisterEffect(e1) --"K9" monsters you control gain 900 ATK the turn your opponent activated a monster effect in the hand or GY 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:SetCondition(function(e) return Duel.GetCustomActivityCount(id,1-e:GetHandlerPlayer(),ACTIVITY_CHAIN)>0 end) e2:SetTarget(function(e,c) return c:IsSetCard(SET_K9) end) e2:SetValue(900) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) --Set 1 "K9" Quick-Play Spell from your Deck or GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.setcon) e3:SetTarget(s.settg) e3:SetOperation(s.setop) c:RegisterEffect(e3) end s.listed_series={SET_K9} function s.chainfilter(re,tp,cid) return not (re:IsMonsterEffect() and re:GetActivateLocation()&(LOCATION_HAND|LOCATION_GRAVE)>0) end function s.thfilter(c) return c:IsSetCard(SET_K9) and c:IsMonster() and c:IsAbleToHand() end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) 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) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end function s.setcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_STZONE) end function s.setfilter(c) return c:IsSetCard(SET_K9) and c:IsQuickPlaySpell() 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|LOCATION_GRAVE,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,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK|LOCATION_GRAVE,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:
You can discard this card to the Graveyard; add 1 "Jurassic World" from your Deck to your hand.
--キラーザウルス --Destroyersaurus 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_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(Cost.SelfDiscardToGrave) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={10080320} function s.filter(c) return c:IsCode(10080320) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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,chk) local tg=Duel.GetFirstMatchingCard(s.filter,tp,LOCATION_DECK,0,nil) if tg then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Gains 100 ATK for each Plant monster you control. Other Plant monsters on the field cannot be destroyed by card effects.
--桜姫タレイア --Talaya, Princess of Cherry Blossoms local s,id=GetID() function s.initial_effect(c) --atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(s.val) c:RegisterEffect(e1) -- local e2=Effect.CreateEffect(c) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.target) e2:SetValue(1) c:RegisterEffect(e2) end function s.val(e,c) return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PLANT),c:GetControler(),LOCATION_MZONE,0,nil)*100 end function s.target(e,c) return c~=e:GetHandler() and c:IsRace(RACE_PLANT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Spell/Trap Card, or monster effect, is activated that targets an "Amazoness" monster on the field: Return that targeted monster to the hand, and if you do, Special Summon 1 other monster from your hand. * The above text is unofficial and describes the card's functionality in the OCG.
--救出劇 --Dramatic Rescue local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_BECOME_TARGET) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_AMAZONESS} function s.confilter(c,tp) return c:IsSetCard(SET_AMAZONESS) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)>0 end function s.condition(e,tp,eg,ep,ev,re,r,rp) return (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsMonsterEffect()) and eg:IsExists(s.confilter,1,nil,tp) end function s.spfilter(c,e,tp) return 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.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end local tg=eg:Filter(s.confilter,nil,tp) Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,#tg,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tg=eg:Filter(s.confilter,nil,tp):Match(Card.IsRelateToEffect,nil,re) if #tg>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)>0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,tg,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:
Add 1 Plant monster with 2400 or more ATK from your Deck to your hand. You can banish this card from your GY; Special Summon 1 Plant monster with 2400 or more ATK from your hand. You can only use 1 "Rose Bell of Revelation" effect per turn, and only once that turn.
--天啓の薔薇の鐘 --Rose Bell of Revelation --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.filter(c) return c:IsAttackAbove(2400) and c:IsRace(RACE_PLANT) 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.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.spfilter(c,e,tp) return c:IsAttackAbove(2400) and c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Select 1 face-up "Karakuri" monster you control. Add 1 Level 4 or lower "Karakuri" monster from your Deck to your hand and change the battle position of the selected monster.
--借カラクリ蔵 --Karakuri Cash Cache local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_POSITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_KARAKURI} function s.filter1(c) return c:IsLevelBelow(4) and c:IsSetCard(SET_KARAKURI) and c:IsAbleToHand() end function s.filter2(c) return c:IsFaceup() and c:IsSetCard(SET_KARAKURI) and c:IsCanChangePosition() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter2(chkc) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingTarget(s.filter2,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) end 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:
There can only be 1 "D.D. Esper Star Sparrow" on the field. Your opponent cannot target other monsters you control with effects or for attacks. When an opponent's monster declares a direct attack while this card is in your Graveyard: You can Special Summon this card from your Graveyard in face-up Defense Position. If Summoned this way, banish it when it leaves the field.
--異次元エスパー・スター・ロビン --D.D. Esper Star Sparrow local s,id=GetID() function s.initial_effect(c) --Can only be 1 copy of this card on the field c:SetUniqueOnField(1,1,id) --Opponent cannot target your other monsters for card effects or attacks local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetValue(s.atlimit) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(s.tglimit) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) --Special summon itself from GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_GRAVE) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end function s.atlimit(e,c) return c~=e:GetHandler() end function s.tglimit(e,c) return c~=e:GetHandler() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then --Banish it if it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster you control is destroyed by battle and sent to the Graveyard, while this card is in your Graveyard: You can Special Summon this card from your Graveyard. If Summoned this way, banish this card when it leaves the field. You can only use the effect of "Interplanetarypurplythorny Beast" once per turn.
--異界の棘紫獣 --Interplanetarypurplythorny Beast local s,id=GetID() function s.initial_effect(c) --Special summon itself from GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_GRAVE) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spfilter(c,tp) return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp) and c:IsMonster() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.spfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it if it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once during this turn, you can Tribute Summon a monster that requires 2 Tributes by banishing 1 monster from each GY instead, also you cannot Special Summon monsters for the rest of this turn.
--埋葬されし生け贄 --Tribute Burial local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetTargetRange(LOCATION_HAND,0) e1:SetCondition(s.otcon) e1:SetTarget(aux.FieldSummonProcTg(s.ottg,s.sumtg)) e1:SetOperation(s.otop) e1:SetCountLimit(1) e1:SetValue(SUMMON_TYPE_TRIBUTE) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_SET_PROC) Duel.RegisterEffect(e2,tp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e3:SetDescription(aux.Stringid(id,1)) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetReset(RESET_PHASE|PHASE_END) e3:SetTargetRange(1,0) Duel.RegisterEffect(e3,tp) end function s.rmfilter(c) return c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c) end function s.otcon(e,c,minc) if c==nil then return true end local tp=c:GetControler() return minc<=2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end function s.ottg(e,c) local mi,ma=c:GetTributeRequirement() return mi<=2 and ma>=2 end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,c) local mg1=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,nil) ::restart:: Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g1=mg1:Select(tp,1,1,true,nil) if not g1 then return false end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=mg2:SelectUnselect(g1,tp,false,false,2,2) if mg2:IsContains(tc) then g1:AddCard(tc) g1:KeepAlive() e:SetLabelObject(g1) return true end goto restart end function s.otop(e,tp,eg,ep,ev,re,r,rp,c) local sg=e:GetLabelObject() if not sg then return end Duel.Remove(sg,POS_FACEUP,REASON_COST) sg:DeleteGroup() Duel.ResetFlagEffect(tp,id) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
As long as this card remains face-up on the field, monsters with an ATK equal to 1900 or more cannot declare an attack.
--ゴラ・タートル --Gora Turtle local s,id=GetID() function s.initial_effect(c) --cannot attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTarget(s.atktarget) c:RegisterEffect(e1) end function s.atktarget(e,c) return c:IsAttackAbove(1900) 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. During your opponent's turn, if this Set card in the Spell & Trap Zone is destroyed and sent to your GY: Special Summon it. If this card is Special Summoned during your opponent's turn: Target 1 "Artifact" monster in your GY; Special Summon it in Defense Position, also you cannot Special Summon monsters until the end of the next turn, except "Artifact" monsters. You can only use this effect of "Artifact Mjollnir" once per turn.
--アーティファクト-ミョルニル --Artifact Mjollnir local s,id=GetID() function s.initial_effect(c) --Set itself to the Spell/Trap Zone 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 this card from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.spcon1) e2:SetTarget(s.sptg1) e2:SetOperation(s.spop1) c:RegisterEffect(e2) --Special Summon 1 "Artifact" monster from the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) e3:SetCondition(s.spcon2) e3:SetTarget(s.sptg2) e3:SetOperation(s.spop2) c:RegisterEffect(e3) end s.listed_series={SET_ARTIFACT} function s.spcon1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsReason(REASON_DESTROY) and Duel.IsTurnPlayer(1-tp) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ARTIFACT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then e:SetCategory(CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end --You cannot Special Summon monsters until the end of the next turn, except "Artifact" monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END,2) Duel.RegisterEffect(e1,tp) end function s.splimit(e,c) return not c:IsSetCard(SET_ARTIFACT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card you control is destroyed by your opponent's card (either by battle or by card effect) and sent to your Graveyard, you can select 1 "Stardust Dragon" in your Graveyard and Special Summon it in face-up Defense Position. You can remove from play this card in the Graveyard to select 1 face-up Dragon-Type Synchro Monster you control. Once per turn, that Synchro Monster cannot be destroyed by battle, but each time this effect is applied, it loses 800 ATK and DEF at the end of the Damage Step.
--スターダスト・ファントム --Stardust Phantom local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --indes local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.indtg) e2:SetOperation(s.indop) c:RegisterEffect(e2) end s.listed_names={CARD_STARDUST_DRAGON} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return rp~=tp and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY) end function s.spfilter(c,e,tp) return c:IsCode(CARD_STARDUST_DRAGON) 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.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.indfilter(c) return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) end function s.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.indfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.indfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.indfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.indop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetCountLimit(1) e1:SetValue(s.valcon) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetOperation(s.addown) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end end function s.valcon(e,re,r,rp) if (r&REASON_BATTLE)~=0 then e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE,0,1) return true else return false end end function s.addown(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():GetFlagEffect(id)==0 then return end local e1=Effect.CreateEffect(e:GetOwner()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-800) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e:GetHandler():RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) e:GetHandler():RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Link Monster's effect is activated that targets this face-up card on the field (Quick Effect): You can destroy this card, then send 1 Spell/Trap on the field to the GY. During the End Phase, if this card is in the GY because it was destroyed on the field by battle or card effect and sent there this turn: You can Special Summon 1 "Rokket" monster from your Deck, except "Autorokket Dragon". You can only use each effect of "Autorokket Dragon" once per turn.
--オートヴァレット・ドラゴン --Autorokket Dragon local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_TO_GRAVE) e2:SetOperation(s.regop) c:RegisterEffect(e2) end s.listed_series={SET_ROKKET} function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or not g:IsContains(c) then return false end return re:IsActiveType(TYPE_LINK) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if chk==0 then return c:IsDestructable() and #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) and Duel.Destroy(e:GetHandler(),REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if #g==0 then return end Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sg=g:Select(tp,1,1,nil) Duel.SendtoGrave(sg,REASON_EFFECT) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1,{id,1}) e1:SetRange(LOCATION_GRAVE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ROKKET) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can target 1 "Graydle" monster in your Graveyard; for the rest of this turn, you cannot Special Summon other monsters, except WATER monsters, also Special Summon that monster, then you can Special Summon from your hand, 1 Aqua-Type monster with the same Level as the monster Special Summoned by this card's effect. When this card is destroyed by battle and sent to the Graveyard: You can Special Summon 1 "Graydle" monster from your Deck.
--グレイドル・スライムJr. --Graydle Slime Jr. local s,id=GetID() function s.initial_effect(c) --special summon from grave+hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --special summon from deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCondition(s.spcon2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end s.listed_series={SET_GRAYDLE} function s.spfilter1(c,e,tp) return c:IsSetCard(SET_GRAYDLE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter1(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spfilter2(c,e,tp,lv) return c:IsRace(RACE_AQUA) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then local g=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_HAND,0,nil,e,tp,tc:GetLevel()) if #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end 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) return not c:IsAttribute(ATTRIBUTE_WATER) end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) 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.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster your opponent controls activates its effect: You can send 1 face-up "Blackwing" monster you control to the GY; negate the activation, and if you do, destroy it, then, you can Special Summon 1 "Black-Winged Dragon" from your Extra Deck. If you control a "Blackwing" Synchro Monster or "Black-Winged Dragon", you can activate this card from your hand.
--ブラック・バード・クローズ --Blackbird Close --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Negate the activation of a monster effect and Special Summon 1 "Black-Winged Dragon" local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Can be activated from the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCondition(s.handcon) c:RegisterEffect(e2) end s.listed_series={SET_BLACKWING} s.listed_names={CARD_BLACK_WINGED_DRAGON} function s.condition(e,tp,eg,ep,ev,re,r,rp) local p,loct=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION) return loct==LOCATION_MZONE and re:IsMonsterEffect() and p~=tp and Duel.IsChainNegatable(ev) end function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_BLACKWING) and c:IsAbleToGraveAsCost() and not c:IsStatus(STATUS_BATTLE_DESTROYED) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SendtoGrave(g,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_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.spfilter(c,e,tp) return c:IsCode(CARD_BLACK_WINGED_DRAGON) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not Duel.NegateActivation(ev) then return end if re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp) if loc~=0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end function s.filter(c) return c:IsFaceup() and (c:IsCode(CARD_BLACK_WINGED_DRAGON) or (c:IsSetCard(SET_BLACKWING) and c:IsType(TYPE_SYNCHRO))) end function s.handcon(e) return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a face-up Spell/Trap is on the field: You can Special Summon this card from your hand. You can Tribute 1 Winged Beast monster, then target 1 face-up Spell/Trap on the field; return that face-up card to the hand, but for the rest of this turn, you cannot activate cards, or the effects of cards, with the same name that card had once it returned to the hand. This is a Quick Effect if all monsters you control are Winged Beast monsters (min. 1). You can only use each effect of "Laughing Puffin" once per turn.
--道化鳥ラフィンパフィン --Laughing Puffin --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Return 1 face-up Spell/Trap to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(aux.NOT(s.quickcond)) e2:SetCost(s.retcost) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) c:RegisterEffect(e2) --Quick if the player controls only Winged-Beast monsters local e3=e2:Clone() e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e3:SetCondition(s.quickcond) c:RegisterEffect(e3) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSpellTrap),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.cfilter(c) return c:IsRace(RACE_WINGEDBEAST) end function s.retfilter(c,e) return c:IsSpellTrap() and c:IsFaceup() and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end function s.retcost(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.retfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,aux.ReleaseCheckTarget,nil,dg) end local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,aux.ReleaseCheckTarget,nil,dg) Duel.Release(g,REASON_COST) end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.retfilter(chkc,e) end if chk==0 then return Duel.IsExistingTarget(s.retfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.retfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then local og=Duel.GetOperatedGroup() --Cannot activate cards or effects with the same name local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(s.aclimit) e1:SetLabel(og:GetFirst():GetCode()) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end end function s.aclimit(e,re,tp) return re:GetHandler():IsCode(e:GetLabel()) end function s.quickcond(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) return #g>0 and g:FilterCount(aux.FaceupFilter(Card.IsRace,RACE_WINGEDBEAST),nil)==#g end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 Synchro Monster; Special Summon 1 "/Assault Mode" monster, whose name includes the Tributed monster's name, from your Deck in Attack Position.
--バスター・モード --Assault Mode Activate local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_ASSAULT_MODE} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function s.filter1(c,e,tp,ft) return c:IsType(TYPE_SYNCHRO) and (ft>0 or (c:GetSequence()<5 and c:IsControler(tp))) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,c:GetCode(),e,tp) end function s.filter2(c,tcode,e,tp) return c:IsSetCard(SET_ASSAULT_MODE) and c.assault_mode and c.assault_mode==tcode and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then if e:GetLabel()~=1 then return false end e:SetLabel(0) return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.filter1,1,false,nil,nil,e,tp,ft) end local rg=Duel.SelectReleaseGroupCost(tp,s.filter1,1,1,false,nil,nil,e,tp,ft) Duel.SetTargetParam(rg:GetFirst():GetCode()) Duel.Release(rg,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local code=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,code,e,tp):GetFirst() if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK)>0 then tc:CompleteProcedure() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot attack directly. If this card is banished: You can Special Summon this card, and if you do, this card gains 200 ATK for each of your banished Dinosaur monsters. You can only use this effect of "Giant Rex" once per turn.
--ジャイアント・レックス --Giant Rex local s,id=GetID() function s.initial_effect(c) --cannot direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_REMOVE) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCountLimit(1,id) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) 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) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsRace,RACE_DINOSAUR),tp,LOCATION_REMOVED,0,nil) if #g>0 then 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(#g*200) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Monsters your opponent controls cannot target face-up Spellcaster-Type monsters for attacks, except this one.
--マジシャンズ・ヴァルキリア --Magician's Valkyria local s,id=GetID() function s.initial_effect(c) --cannot be battle target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetValue(s.tg) c:RegisterEffect(e1) end function s.tg(e,c) return c~=e:GetHandler() and c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: Add 1 "Uria, Lord of Searing Flames", "Hamon, Lord of Striking Thunder", or "Raviel, Lord of Phantasms", OR 1 monster that specifically lists any of those cards in its text, from your Deck to your hand. Once per turn: You can discard 1 card; Special Summon 1 Fiend monster with 0 ATK/DEF from your GY. Once per turn, if you control a Level 10 monster: You can add 1 Continuous Spell from your GY to your hand. You can only activate 1 "Opening of the Spirit Gates" per turn.
--七精の解門 --Opening of the Spirit Gates --Scripted by AlphaKretin 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_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) --Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Return to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCost(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_names={69890967,6007213,32491822} function s.filter(c) return (c:IsCode(69890967,6007213,32491822) or (c:ListsCode(69890967,6007213,32491822) and c:IsMonster())) 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.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end 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.spfilter(c,e,tp) return c:IsRace(RACE_FIEND) and c:IsAttack(0) and c:IsDefense(0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsLevel,10),tp,LOCATION_MZONE,0,1,nil) end function s.thfilter(c) return c:IsSpell() and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card's name is always treated as "Harpie Lady".)
--ハーピィ・レディ・SB --Cyber Harpie Lady local s,id=GetID() function s.initial_effect(c) end s.listed_names={CARD_HARPIE_LADY}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner monsters If this card destroys an opponent's monster by battle and sends it to the Graveyard: Your opponent cannot Normal or Special Summon Level 5 or higher monsters during their next turn.
--クリムゾン・ブレーダー --Crimson Blader local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCondition(aux.bdogcon) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(0,1) e1:SetCondition(s.sumcon) e1:SetTarget(s.sumlimit) e1:SetLabel(Duel.GetTurnCount()) if Duel.IsTurnPlayer(tp) then e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN) else e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,2) end Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_SUMMON) Duel.RegisterEffect(e2,tp) end function s.sumcon(e) return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()~=e:GetOwnerPlayer() end function s.sumlimit(e,c) return c:IsLevelAbove(5) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Discard 1 card; add 1 Level 1 LIGHT Tuner, and 1 Spell/Trap that mentions "Blue-Eyes White Dragon", from your Deck to your hand, except "Wishes for Eyes of Blue". You can banish this card from your GY, then target 1 "Blue-Eyes White Dragon" you control; equip 1 "Blue-Eyes" monster from your Extra Deck to it as an Equip Spell that gives it 400 ATK. You can only use each effect of "Wishes for Eyes of Blue" once per turn.
--青き眼の祈り --Wishes for Eyes of Blue --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Add 1 Level 1 LIGHT Tuner and 1 Spell/Trap that mentions "Blue-Eyes White Dragon" from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Equip 1 "Blue-Eyes" monster from your Extra Deck to 1 "Blue-Eyes White Dragon" you control as an Equip Spell that gives it 400 ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.eqtg) e2:SetOperation(s.eqop) c:RegisterEffect(e2) end s.listed_names={CARD_BLUEEYES_W_DRAGON,id} 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,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.thfilter(c) return ((c:IsLevel(1) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_TUNER)) or (c:IsSpellTrap() and c:ListsCode(CARD_BLUEEYES_W_DRAGON) and not c:IsCode(id))) and c:IsAbleToHand() end function s.rescon(sg,e,tp,mg) return sg:FilterCount(Card.IsMonster,nil)==1 end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) return aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #g<2 then return end local rg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_ATOHAND) if #rg>0 then Duel.SendtoHand(rg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,rg) end end function s.eqfilter(c,tp) return c:IsSetCard(SET_BLUE_EYES) and c:CheckUniqueOnField(tp) and not c:IsForbidden() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsCode(CARD_BLUEEYES_W_DRAGON) and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsCode,CARD_BLUEEYES_W_DRAGON),tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_EXTRA,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsCode,CARD_BLUEEYES_W_DRAGON),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_EXTRA) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp):GetFirst() if ec and Duel.Equip(tp,ec,tc) then --The equipped monster gains 400 ATK local e1=Effect.CreateEffect(ec) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(400) e1:SetReset(RESET_EVENT|RESETS_STANDARD) ec:RegisterEffect(e1) --Equip limit local e2=Effect.CreateEffect(ec) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetValue(function(e,c) return c==tc end) e2:SetReset(RESET_EVENT|RESETS_STANDARD) ec:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Each turn, the first Pendulum Monster(s) you control that would be destroyed by an opponent's card effect, is not destroyed. ---------------------------------------- [ Monster Effect ] When this card is Pendulum Summoned from the hand (and no other cards are Pendulum Summoned at the same time): You can make this card's ATK become double its original ATK. Once per turn: You can target 1 monster on the field; banish both it and this card from the field until your next Standby Phase.
--刻剣の魔術師 --Timebreaker Magician local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --indes local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e2:SetRange(LOCATION_PZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(s.indtg) e2:SetValue(s.indval) c:RegisterEffect(e2) --double local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCondition(s.atkcon) e3:SetOperation(s.atkop) c:RegisterEffect(e3) --Banish local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetTarget(s.rmtg) e4:SetOperation(s.rmop) c:RegisterEffect(e4) end function s.indtg(e,c) return c:IsType(TYPE_PENDULUM) end function s.indval(e,re,r,rp) if (r&REASON_EFFECT)~=0 and e:GetHandlerPlayer()~=rp then return 1 else return 0 end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return #eg==1 and eg:GetFirst()==c and c:IsPendulumSummoned() and c:IsPreviousLocation(LOCATION_HAND) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(c:GetBaseAttack()*2) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler()) g:AddCard(e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end local g=Group.FromCards(c,tc) if Duel.Remove(g,0,REASON_EFFECT|REASON_TEMPORARY)~=0 then local og=Duel.GetOperatedGroup() local oc=og:GetFirst() for oc in aux.Next(og) do if oc:IsControler(tp) then oc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,1) else oc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_OPPO_TURN,0,1) end end og:KeepAlive() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetReset(RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN) e1:SetCountLimit(1) e1:SetLabelObject(og) e1:SetCondition(s.retcon) e1:SetOperation(s.retop) Duel.RegisterEffect(e1,tp) end end function s.retfilter(c) return c:GetFlagEffect(id)~=0 end function s.retcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local sg=g:Filter(s.retfilter,nil) if #sg>1 and sg:GetClassCount(Card.GetPreviousControler)==1 then local ft=Duel.GetLocationCount(sg:GetFirst():GetPreviousControler(),LOCATION_MZONE) if ft==1 then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,0)) local tc=sg:Select(tp,1,1,nil):GetFirst() Duel.ReturnToField(tc) sg:RemoveCard(tc) end end local tc=sg:GetFirst() for tc in aux.Next(sg) do Duel.ReturnToField(tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
At the start of the Damage Step, if this card battles an opponent's monster: You can return both the opponent's monster and this card to the hand.
--N・グラン・モール --Neo-Spacian Grand Mole local s,id=GetID() function s.initial_effect(c) --return to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetAttackTarget()==c or (Duel.GetAttacker()==c and Duel.GetAttackTarget()~=nil) end local g=Group.FromCards(Duel.GetAttacker(),Duel.GetAttackTarget()) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local g=Group.CreateGroup() local c=Duel.GetAttacker() if c:IsRelateToBattle() then g:AddCard(c) end c=Duel.GetAttackTarget() if c~=nil and c:IsRelateToBattle() then g:AddCard(c) end if #g>0 then Duel.SendtoHand(g, nil, REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 of your Machine or Rock monsters, that is banished or is in your GY, that cannot be Normal Summoned/Set; Special Summon it.
--マグネット・リバース --Magnet Reverse local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsRace(RACE_MACHINE|RACE_ROCK) and not c:IsSummonableCard() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During each of your End Phases, destroy this card unless you send 1 "Iron Core of Koa'ki Meiru" from your hand to the Graveyard or reveal 1 Warrior-Type monster in your hand. If this card destroys an opponent's monster by battle, it can attack once again in a row.
--コアキメイル・ベルグザーク --Koa'ki Meiru Bergzak local s,id=GetID() function s.initial_effect(c) --cost local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.mtcon) e1:SetOperation(s.mtop) c:RegisterEffect(e1) --chain attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,3)) 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 s.listed_names={36623431} function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.cfilter1(c) return c:IsCode(36623431) and c:IsAbleToGraveAsCost() end function s.cfilter2(c) return c:IsMonster() and c:IsRace(RACE_WARRIOR) and not c:IsPublic() end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.HintSelection(Group.FromCards(c)) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil) local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_HAND,0,nil) local select=2 Duel.Hint(HINT_SELECTMSG,tp,0) if #g1>0 and #g2>0 then select=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2)) elseif #g1>0 then select=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,2)) if select==1 then select=2 end elseif #g2>0 then select=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))+1 else select=Duel.SelectOption(tp,aux.Stringid(id,2)) select=2 end if select==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=g1:Select(tp,1,1,nil) Duel.SendtoGrave(g,REASON_COST) elseif select==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=g2:Select(tp,1,1,nil) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) else Duel.Destroy(c,REASON_COST) end end function s.atcon(e,tp,eg,ep,ev,re,r,rp) return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():CanChainAttack() 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:
Special Summon 1 "Chrysalis" monster from your Deck for each "Neo-Spacian" monster with a different name in your Graveyard.
--コクーン・パーティ --Cocoon Party 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.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_NEO_SPACIAN,SET_CHRYSALIS} function s.gfilter(c) return c:IsSetCard(SET_NEO_SPACIAN) and c:IsMonster() end function s.spfilter(c,e,tp) return c:IsSetCard(SET_CHRYSALIS) 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 local g=Duel.GetMatchingGroup(s.gfilter,tp,LOCATION_GRAVE,0,nil) local ct=s.count_unique_code(g) e:SetLabel(ct) return ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,ct,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,e:GetLabel(),tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.gfilter,tp,LOCATION_GRAVE,0,nil) local ct=s.count_unique_code(g) if ct==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<ct then return end local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if #sg<ct then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local spg=sg:Select(tp,ct,ct,nil) Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP) end function s.count_unique_code(g) local check={} local count=0 local tc=g:GetFirst() for tc in aux.Next(g) do for i,code in ipairs({tc:GetCode()}) do if not check[code] then check[code]=true count=count+1 end end end return count end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a face-up Insect monster is destroyed by battle or card effect and sent to the GY: Its controller can add 1 Insect monster with the same Level as the destroyed monster from their Deck to their hand.
--大樹海 --Verdant Sanctuary local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --trigger local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER) e2:SetCode(EVENT_CUSTOM+id) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_TO_GRAVE) ge1:SetOperation(s.check) Duel.RegisterEffect(ge1,0) end) end function s.check(e,tp,eg,ep,ev,re,r,rp) for tc in aux.Next(eg) do if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsReason(REASON_DESTROY) and tc:IsRace(RACE_INSECT) and tc:GetLevel()~=0 and tc:IsPreviousPosition(POS_FACEUP) then Duel.RaiseEvent(tc,EVENT_CUSTOM+id,re,r,rp,tc:GetControler(),tc:GetLevel()) end end end function s.filter(c,lv) return c:IsRace(RACE_INSECT) and c:GetLevel()==lv 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,ev) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,ev) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this face-up card would leave the field, banish it instead. You can only use each of the following effects of "Floowandereeze & Stri" once per turn, and cannot Special Summon during the turn you activate either effect. If this card is Normal Summoned: You can target 1 card in either GY; banish it, then immediately after this effect resolves, you can Normal Summon 1 Winged Beast monster. If a Winged Beast monster is Normal Summoned to your field while this card is banished: You can add this card to your hand.
--ふわんだりぃず×すとりー --Floowandereeze & Stri --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Banish 1 card from either GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SUMMON) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.nstg) e1:SetOperation(s.nsop) c:RegisterEffect(e1) --Banish itself it it leaves the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCondition(function(e)return e:GetHandler():IsFaceup()end) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2) --Add this banished card to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCountLimit(1,{id,1}) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_REMOVED) e3:SetCost(s.cost) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return eg:IsExists(s.thfilter,1,nil,tp)end) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end --Cannot special summon the turn you activate e1 or e3 function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetActivityCount(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) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e2:SetDescription(aux.Stringid(id,2)) e2:SetReset(RESET_PHASE|PHASE_END) e2:SetTargetRange(1,0) Duel.RegisterEffect(e2,tp) end --Check for a card to banish function s.rmfilter(c) return c:IsAbleToRemove() and aux.SpElimFilter(c) end --Activation legality function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.rmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.sumfilter(c) return c:IsRace(RACE_WINGEDBEAST) and c:IsSummonable(true,nil) end --Banish 1 card from either GY function s.nsop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)<=0 then return end --Normal summon 1 winged beast monster local sg1=Duel.GetMatchingGroup(s.sumfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,nil) if #sg1>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.BreakEffect() Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local sg2=sg1:Select(tp,1,1,nil):GetFirst() Duel.Summon(tp,sg2,true,nil) end end end --Check if a winged beast monster is normal summoned to your field function s.thfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_WINGEDBEAST) end --Activation legality function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) end --Add this banished card to hand function s.thop(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:
If this card is destroyed by battle and sent to the GY: Target 2 cards in your opponent's GY; shuffle them into the Deck.
--ケルドウ --Keldo local s,id=GetID() function s.initial_effect(c) --todeck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) end function s.filter(c,e) return c:IsAbleToDeck() and c:IsCanBeEffectTarget(e) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.filter(chkc,e) end if chk==0 then return true end local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_GRAVE,nil,e) if #g>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local sg=g:Select(tp,2,2,nil) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,2,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) Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end