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:
|
FLIP: Each player takes 1000 damage. If this card is destroyed by battle or card effect and sent to the GY: Inflict 1000 damage to your opponent. You can only use each effect of "Self-Destruct Ant" once per turn.
|
--アリジバク
--Self-Destruct Ant
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,1000)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT,true)
Duel.Damage(1-tp,1000,REASON_EFFECT,true)
Duel.RDComplete()
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
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(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
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:
|
Once per turn, if your opponent controls a monster and you control no monsters, you can pay 800 Life Points to Special Summon 1 Psychic-Type monster from your hand.
|
--アポート
--Teleport
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.condition)
e1:SetCost(Cost.PayLP(800))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0
end
function s.filter(c,e,sp)
return c:IsRace(RACE_PSYCHIC) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
or Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You cannot Xyz Summon monsters with the same name as a card you control. You can target 2 "Ryzeal" cards in your GY, except "Ryzeal Cross"; place them on the bottom of the Deck in any order, then draw 1 card. You can only use this effect of "Ryzeal Cross" once per turn. Once per turn, when a monster effect activated by your opponent resolves, you can detach 1 material from a "Ryzeal" Xyz Monster you control, and if you do, negate that effect.
|
--ライゼオル・クロス
--Ryzeal Cross
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--You cannot Xyz Summon monsters with the same name as a card you control
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(s.xyzlimit)
c:RegisterEffect(e1)
--Place 2 "Ryzeal" cards from your GY on the bottom of the Deck then draw 1 card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
--Detach 1 material from a "Ryzeal" Xyz Monster you control, and if you do, negate an opponent's activated monster effect when it resolves
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(s.negcon)
e3:SetOperation(s.negop)
c:RegisterEffect(e3)
end
s.listed_series={SET_RYZEAL}
s.listed_names={id}
function s.xyzlimit(e,c,sump,sumtyp)
return (sumtyp&SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,c:GetCode()),sump,LOCATION_ONFIELD,0,1,nil)
end
function s.tdfilter(c)
return c:IsSetCard(SET_RYZEAL) and c:IsAbleToDeck() and not c:IsCode(id)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetCards(e)
if #tg==0 or Duel.SendtoDeck(tg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)==0 then return end
local dg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA)
if #dg==0 then return end
local ct=dg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
if ct>1 then
Duel.SortDeckbottom(tp,tp,ct)
end
if Duel.IsPlayerCanDraw(tp) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.xyzfilter(c)
return c:IsSetCard(SET_RYZEAL) and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0 and c:IsFaceup()
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil)
return rp==1-tp and re:IsMonsterEffect() and Duel.IsChainDisablable(ev) and not e:GetHandler():HasFlagEffect(id)
and #g>0 and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT,g)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if not (Duel.GetFlagEffectLabel(tp,id)~=cid and #g>0 and Duel.SelectEffectYesNo(tp,c)) then return end
Duel.Hint(HINT_CARD,0,id)
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT,g)
Duel.NegateEffect(ev)
c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1,cid)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During damage calculation, if a monster you control is being attacked: Target that monster you control; that target gains ATK equal to half the original ATK of the attacking monster, until the end of this turn.
|
--ハーフ・カウンター
--Half Counter
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetAttackTarget()
return t and t:IsControler(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttackTarget()
if chkc then return chkc==tg end
if chk==0 then return Duel.GetAttacker():IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=Duel.GetAttacker():GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(atk/2)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You can target 1 "Performage" Xyz Monster you control; attach this card to it as material. If a card(s) is added to your Extra Deck (except during the Damage Step): You can add 1 face-up "Performage" Pendulum Monster from your Extra Deck to your hand. You can only use each effect of "Performage Cup Tricker" once per turn. ---------------------------------------- [ Monster Effect ] If this card is in your hand: You can target 1 Xyz Monster on the field; detach 1 material from it, and if you do, Special Summon this card, then make 1 Xyz Monster on the field lose 600 ATK. If this card is detached from an Xyz Monster and sent to the GY to activate that monster's effect: You can target 2 Xyz Monsters you control; attach 1 material from 1 of those monsters to the other. You can only use each effect of "Performage Cup Tricker" once per turn.
|
--Emカップ・トリッカー
--Performage Cup Tricker
--Scripted by The Razgriz
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon procedure
Pendulum.AddProcedure(c)
--Attach this card to 1 "Performage" Xyz Monster you control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.pendattachtg)
e1:SetOperation(s.pendattachop)
c:RegisterEffect(e1)
--Add 1 "Performage" monster from your face-up Extra Deck to your hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_DECK)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--Detach 1 material from an Xyz Monster and Special Summon this card
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,{id,2})
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--Attach 1 material from 1 Xyz Monster to another Xyz Monster
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,{id,3})
e4:SetCondition(s.attachcon)
e4:SetTarget(s.attachtg)
e4:SetOperation(s.attachop)
c:RegisterEffect(e4)
end
s.listed_series={SET_PERFORMAGE}
function s.pendattachfilter(c,tp,hc)
return c:IsSetCard(SET_PERFORMAGE) and c:IsType(TYPE_XYZ) and c:IsFaceup() and hc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT)
end
function s.pendattachtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.pendattachfilter(chkc,tp,c) end
if chk==0 then return Duel.IsExistingTarget(s.pendattachfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACH)
Duel.SelectTarget(tp,s.pendattachfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
end
function s.pendattachop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,c)
end
end
function s.thconfilter(c,tp)
return c:IsLocation(LOCATION_EXTRA) and c:IsControler(tp)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.thconfilter,1,nil,tp)
end
function s.thfilter(c)
return c:IsSetCard(SET_PERFORMAGE) and c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.detachfilter(c,tp)
return c:IsType(TYPE_XYZ) and c:IsFaceup() and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.detachfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.detachfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
Duel.SelectTarget(tp,s.detachfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
local sc=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsType,TYPE_XYZ),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if not sc then return end
Duel.HintSelection(sc)
Duel.BreakEffect()
--1 Xyz Monster onthe field loses 600 ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
sc:RegisterEffect(e1)
end
end
function s.attachcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function s.xyzfilter(c,e)
return c:IsType(TYPE_XYZ) and c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function s.rescon(sg,e,tp,mg)
return sg:IsExists(Card.CheckRemoveOverlayCard,1,nil,tp,1,REASON_EFFECT)
end
function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET)
Duel.SetTargetCard(tg)
end
function s.attachop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetCards(e)
if #tg~=2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local detachxyz=tg:FilterSelect(tp,Card.CheckRemoveOverlayCard,1,1,nil,tp,1,REASON_EFFECT):GetFirst()
if not detachxyz then return end
local attachxyz=tg:RemoveCard(detachxyz):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACH)
local attach_group=detachxyz:GetOverlayGroup():Select(tp,1,1,nil)
Duel.Overlay(attachxyz,attach_group)
Duel.RaiseSingleEvent(detachxyz,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Machine monsters If this card is Link Summoned: You can add 1 "R.B." Spell from your Deck to your hand. If this card is in the Extra Monster Zone: You can Special Summon 1 "R.B." monster from your hand or GY in Defense Position, then you can move this card you control to another of your Main Monster Zones, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Machine monsters with 1500 or less ATK. You can only use each effect of "R.B. VALCan Booster" once per turn.
|
--
--R.B. VALCan Booster
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Link Summon procedure: 2 Machine monsters
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_MACHINE),2,2)
--Add 1 "R.B." Spell from your Deck to your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() end)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Special Summon 1 "R.B." monster from your hand or GY in Defense Position, then you can move this card you control to another of your Main Monster Zones
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_EMZONE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_series={SET_RB}
function s.thfilter(c)
return c:IsSetCard(SET_RB) and c:IsSpell() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_RB) 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 chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0
and c:IsRelateToEffect(e) and c:IsControler(tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local seq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0),2)
Duel.BreakEffect()
Duel.MoveSequence(c,seq)
end
end
--You cannot Special Summon from the Extra Deck for the rest of this turn, except Machine monsters with 1500 or less ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not (c:IsRace(RACE_MACHINE) and c:IsAttackBelow(1500)) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--"Clock Lizard" check
aux.addTempLizardCheck(c,tp,function(e,c)
local atk=c:GetTextAttack()
return not c:IsOriginalRace(RACE_MACHINE) or atk==-2 or atk>1500
end)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You cannot Pendulum Summon monsters, except "Ninja" monsters. This effect cannot be negated. Once per turn, when your "Ninja" monster declares an attack: You can make that monster gain 1000 ATK until the end of the Damage Step (even if this card leaves the field). ---------------------------------------- [ Monster Effect ] You can Tribute this card, then target 1 "Ninja" monster you control; it gains 800 ATK until the end of this turn.
|
--黄昏の忍者-カゲン
--Twilight Ninja Kagen
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
Pendulum.AddProcedure(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
c:RegisterEffect(e1)
--ATK change (atack declaration)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.atkcon)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--ATK change (ignition)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(Cost.SelfTribute)
e3:SetTarget(s.tg)
e3:SetOperation(s.op)
c:RegisterEffect(e3)
end
s.listed_series={SET_NINJA}
function s.splimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(SET_NINJA) and (sumtp&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:IsControler(tp) and at:IsSetCard(SET_NINJA)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local at=Duel.GetAttacker()
if at:IsFaceup() and at:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE)
at:RegisterEffect(e1)
end
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_NINJA)
end
function s.tg(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,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(800)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Tribute this card; Special Summon up to 2 "Penguin" monsters from your Deck, except "The Great Emperor Penguin".
|
--大皇帝ペンギン
--The Great Emperor Penguin
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(Cost.SelfTribute)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsSetCard(SET_PENGUIN) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_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)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,ft,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:
|
"Frenzied Panda" + "Ryu-Kishin"
|
--バロックス
--Barox
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,98818516,15303296)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Tribute Summon this card in face-up Attack Position by Tributing 1 Dinosaur monster. When a Dinosaur monster(s) is Special Summoned from your GY while this monster is on the field (except during the Damage Step): You can draw 1 card.
|
--超古代恐獣
--Super-Ancient Dinobeast
local s,id=GetID()
function s.initial_effect(c)
--summon with 1 tribute
local e1=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
function s.otfilter(c,tp)
return c:IsRace(RACE_DINOSAUR) and (c:IsControler(tp) or c:IsFaceup())
end
function s.cfilter(c,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsPreviousLocation(LOCATION_GRAVE)
and c:IsPreviousControler(tp)
end
function s.drcon(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.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
(This card is always treated as an "Archfiend" card.) If a Level 8 or higher monster under your control was sent to the Graveyard this turn: Special Summon 1 "Berserk Dragon" from your hand or Deck.
|
--デーモンとの駆け引き
--A Deal with Dark Ruler
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)
aux.GlobalCheck(s,function()
s[0]=false
s[1]=false
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
aux.AddValuesReset(function()
s[0]=false
s[1]=false
end)
end)
end
s.listed_names={85605684}
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
for tc in aux.Next(eg) do
if tc:IsLevelAbove(8) and tc:IsPreviousLocation(LOCATION_MZONE) then
s[tc:GetPreviousControler()]=true
end
end
end
function s.filter(c,e,tp)
return c:IsCode(85605684) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return s[tp] and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 Level 7 or 8 Dragon monster in your GY; Special Summon it. If a Dragon monster(s) you control would be destroyed by battle or card effect, you can banish this card from your GY instead.
|
--復活の福音
--Return of the Dragon Lords
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)
--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
function s.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and (c:GetLevel()==7 or c:GetLevel()==8) 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) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsLocation(LOCATION_MZONE) 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 "Despia" monster + 1 LIGHT or DARK monster While you control this Fusion Summoned card, your opponent cannot activate cards or effects unless they pay 600 LP. If your opponent controls a Ritual, Fusion, Synchro, Xyz, or Link Monster, while this card is in your GY (Quick Effect): You can Special Summon this card, but banish it when it leaves the field. You can only use this effect of "Masquerade the Blazing Dragon" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--赫灼竜マスカレイド
--Masquerade the Blazing Dragon
local s,id=GetID()
function s.initial_effect(c)
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DESPIA),s.matfilter)
c:EnableReviveLimit()
--activate cost
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ACTIVATE_COST)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCondition(s.costcon)
e1:SetCost(s.costchk)
e1:SetOperation(s.costop)
c:RegisterEffect(e1)
--accumulate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(id)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCondition(s.costcon)
c:RegisterEffect(e2)
--Special summon itself from hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e3:SetRange(LOCATION_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_DESPIA}
function s.matfilter(c,fc,st,tp)
return c:IsAttribute(ATTRIBUTE_LIGHT,fc,st,tp) or c:IsAttribute(ATTRIBUTE_DARK,fc,st,tp)
end
function s.costcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFusionSummoned()
end
function s.costchk(e,te_or_c,tp)
local ct=#{Duel.GetPlayerEffect(tp,id)}
return Duel.CheckLPCost(tp,ct*600)
end
function s.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,600)
end
function s.spcfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.spcfilter,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) 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 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:
|
Send 2 random Fusion Monsters from your opponent's Extra Deck to the Graveyard.
|
--成功確率0%
--Success Probability 0%
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c)
return (c:IsFacedown() or c:IsType(TYPE_FUSION)) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if chk==0 then return g:FilterCount(s.filter,nil)>=2 end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_EXTRA,0,nil,TYPE_FUSION)
if #g<2 then return end
local rg=g:RandomSelect(tp,2)
Duel.SendtoGrave(rg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Shuffle 1 "Duoterion", 1 "Hydrogeddon", and 1 "Oxygeddon" from your hand and/or GY into the Deck; Special Summon 1 "Water Dragon Cluster" from your hand or GY. You can banish this card from your GY; add 1 "Water Dragon" or "Water Dragon Cluster" from your Deck or GY to your hand.
|
--ボンディング-DHO
--Bonding - DHO
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:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_names={6022371}
function s.cfilter(c,code)
return c:IsCode(code) and c:IsAbleToDeckAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,43017476)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,22587018)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,58071123) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,43017476)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,22587018)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g3=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,58071123)
g1:Merge(g2)
g1:Merge(g3)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoDeck(g1,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsCode(6022371) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
function s.thfilter(c)
return c:IsCode(6022371,85066822) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you use this card you control as Synchro Material, you can treat it as a non-Tuner.
|
--幻影王 ハイド・ライド
--Phantom King Hydride
local s,id=GetID()
function s.initial_effect(c)
--nontuner
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card in your possession is destroyed by your opponent's attack or card effect and sent to your Graveyard: Target 1 face-up Spell/Trap Card your opponent controls; destroy that target. If this card attacks, it is changed to Defense Position at the end of the Damage Step.
|
--パワー・ブレイカー
--Power Breaker
local s,id=GetID()
function s.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--to defense
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(s.poscon)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY) and rp~=tp
and (not c:IsReason(REASON_BATTLE) or c==Duel.GetAttackTarget())
end
function s.dfilter(c)
return c:IsFaceup() and c:IsSpellTrap()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.dfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.dfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() and c:IsRelateToBattle() then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2+ Level 9 monsters If this face-up card would be destroyed, you can detach 1 material from this card instead. Gains the following effects, based on the Attributes of its attached materials. ● FIRE: When this card declares an attack on a monster with higher ATK: You can make this card's ATK become double its current ATK until the end of the Damage Step. ● WATER: Once per opponent's turn (Quick Effect): You can target 1 card you control; this turn, negate any card or effect activated by your opponent that targeted that card.
|
--至鋼の玉 ルーベサフィルス
--Rubysapphirus, the Adamant Jewel
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure: 2+ Level 9 monsters
Xyz.AddProcedure(c,nil,9,2,nil,nil,Xyz.InfiniteMats)
--If this card would be destroyed, you can detach 1 material from this card instead
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.reptg)
c:RegisterEffect(e1)
--Double this card's ATK until the end of the Damage Step
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.atkcon)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--Negate opponent's effects that targets the card targetted by this effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e3:SetCondition(s.negcon)
e3:SetTarget(s.negtg)
e3:SetOperation(s.negop)
c:RegisterEffect(e3)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
return Duel.SelectEffectYesNo(tp,c,96) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)>0
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE) then return false end
local bc=Duel.GetAttackTarget()
return bc and bc:IsFaceup() and bc:GetAttack()>c:GetAttack()
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToBattle() then
--Double this card's ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()*2)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE)
c:RegisterEffect(e1)
end
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER)
end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
--Negate opponent's activated effects that target this card
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(s.discon)
e1:SetOperation(s.disop)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if not (rp==1-tp and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)) then return false end
local tc=e:GetLabelObject()
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tc and tg and tg:IsContains(tc) and tc:HasFlagEffect(id)
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:
|
2+ monsters, including an Insect, Plant, or Reptile monster If your opponent activates a monster effect (except during the Damage Step): You can activate this effect; neither player can activate the effects of monsters in the hand this turn. If this card is in your GY: You can target 1 Insect, Plant, or Reptile monster you control; place it on the bottom of the Deck, and if you do, Special Summon this card, also you cannot Special Summon for the rest of this turn, except Insect, Plant, or Reptile monsters. You can only use each effect of "Ragnaraika Chain Coils" once per turn.
|
--蕾禍ノ鎖蛇巳
--Ragnaraika Chain Coils
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Link Summon procedure
Link.AddProcedure(c,nil,2,4,s.lcheck)
--Apply a "neither player can activate monster effects in the hand" effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re:IsMonsterEffect() and rp==1-tp end)
e1:SetOperation(s.cnntactop)
c:RegisterEffect(e1)
--Place 1 Insect, Plant, or Reptile monster you control on the bottom of the Deck and Special Summon this card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.selfsptg)
e2:SetOperation(s.selfspop)
c:RegisterEffect(e2)
end
function s.lcheck(g,lc,sumtype,tp)
return g:IsExists(Card.IsRace,1,nil,RACE_INSECT|RACE_PLANT|RACE_REPTILE,lc,sumtype,tp)
end
function s.cnntactop(e,tp,eg,ep,ev,re,r,rp)
--Neither player can activate monster effects in the hand for the rest of this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
local rc=re:GetHandler()
return rc and rc:IsLocation(LOCATION_HAND) and re:IsMonsterEffect()
end
function s.tdfilter(c,tp)
return c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) and c:IsFaceup() and c:IsAbleToDeck() and Duel.GetMZoneCount(tp,c)>0
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tdfilter(chkc,tp) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--Cannot Special Summon monsters, except Insect, Plant, and Reptile monsters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(_,c) return not c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
To activate this card you must control no monsters, and a Set Spell/Trap(s) you control must have been destroyed by card effect this turn. During the Main Phase, if exactly 1 monster with less ATK than your LP is Summoned and you have "Z-ONE" in your GY: Destroy that monster, and if you do, take 800 damage, then inflict 800 damage to your opponent.
|
--魂縛門
--Soul Binding Gate
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
c:RegisterEffect(e1)
aux.GlobalCheck(s,function()
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
s.listed_names={62499965}
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:GetPreviousTypeOnField() & (TYPE_SPELL+TYPE_TRAP)~=0 and tc:IsPreviousPosition(POS_FACEDOWN)
and tc:IsPreviousLocation(LOCATION_ONFIELD) and tc:IsReason(REASON_EFFECT) then
Duel.RegisterFlagEffect(tc:GetPreviousControler(),id,RESET_PHASE|PHASE_END,0,1)
end
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return Duel.IsMainPhase() and #eg==1 and tc:IsFaceup() and tc:GetAttack()<Duel.GetLP(tp)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,62499965)
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,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,800)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.Destroy(eg,REASON_EFFECT)>0 and Duel.Damage(tp,800,REASON_EFFECT)>0
and Duel.GetLP(tp)>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,800,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can pay 1000 LP, then target 1 monster your opponent controls and 1 other "Vampire" monster you control; switch control of those monsters. At the end of the Battle Phase, if this card destroyed any monster(s) by battle: You can Special Summon them from the GYs to your field.
|
--ヴァンパイア・レッドバロン
--Vampire Red Baron
local s,id=GetID()
function s.initial_effect(c)
--Change control of 1 "Vampire" monster and 1 opponent's monster
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.PayLP(1000))
e1:SetTarget(s.cttg)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
--Register when destroying a monster
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
--Special Summon monsters destroyed by battle
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE|PHASE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_VAMPIRE}
function s.ctfilter2(c)
return c:IsFaceup() and c:IsSetCard(SET_VAMPIRE) and c:IsAbleToChangeControler()
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(s.ctfilter2,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectTarget(tp,s.ctfilter2,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g1,2,0,0)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local a=g:GetFirst()
local b=g:GetNext()
if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) then
Duel.SwapControl(a,b)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE,0,1)
end
function s.spfilter(c,e,tp,rc,tid)
return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
local g=nil
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount())
if #tg>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=tg:Select(tp,ft,ft,nil)
else
g=tg
end
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card gains effects based on the number of "Harpie" monsters you control, except "Harpie's Pet Baby Dragon". ● 1 or more: Your opponent cannot target "Harpie" monsters you control for attacks, except "Harpie's Pet Baby Dragon". ● 2 or more: Double the original ATK and DEF of this card. ● 3 or more: Once per turn: You can target 1 card your opponent controls; destroy that target.
|
--ハーピィズペット仔竜
--Harpie's Pet Baby Dragon
local s,id=GetID()
function s.initial_effect(c)
--at limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(s.atlimit)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetCondition(s.adcon)
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(s.defval)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_HARPIE) and c:GetCode()~=id
end
function s.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(SET_HARPIE) and c:GetCode()~=id
end
function s.adcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,2,nil)
end
function s.atkval(e,c)
return c:GetBaseAttack()*2
end
function s.defval(e,c)
return c:GetBaseDefense()*2
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,3,nil)
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(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If your opponent controls a monster with 2000 or more ATK, you can Special Summon this card (from your hand).
|
--限界竜シュヴァルツシルト
--Schwarzschild Limit Dragon
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsFaceup() and c:IsAttackAbove(2000)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control "Toon World": Target 1 face-up monster your opponent controls; inflict damage to your opponent equal to the ATK of that face-up monster. You can only activate 1 "Shadow Toon" per turn.
|
--シャドー・トゥーン
--Shadow Toon
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={15259703}
function s.cfilter(c)
return c:IsFaceup() and c:IsCode(15259703)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.filter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card inflicts battle damage to your opponent: You can activate 1 of these effects. ● Target 1 Spell/Trap on the field; destroy that target. ● Send the top 2 cards of their Deck to the GY.
|
--黒蠍-罠はずしのクリフ
--Dark Scorpion - Cliff the Trap Remover
local s,id=GetID()
function s.initial_effect(c)
--Activate 1 of these effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp end)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
local b1=Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsPlayerCanDiscardDeck(1-tp,2)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetCategory(CATEGORY_DECKDES)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
--Destroy 1 Spell/Trap on the field
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
else
--Send the top 2 cards of your opponent's Deck to the GY
Duel.DiscardDeck(1-tp,2,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send 1 Equip Card equipped to this card to the Graveyard. Inflict 500 points of damage to your opponent's Life Points.
|
--リーフ・フェアリー
--Woodland Sprite
local s,id=GetID()
function s.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c,ec)
return c:GetEquipTarget()==ec and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e:GetHandler())
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.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters Once per turn (Quick Effect): You can detach 1 material from this card, then target 1 Spell/Trap on the field; destroy it.
|
--竜巻竜
--Tornado Dragon
local s,id=GetID()
function s.initial_effect(c)
--Xyz Summon
Xyz.AddProcedure(c,nil,4,2)
c:EnableReviveLimit()
--Destroy 1 Spell/Trap
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(Cost.DetachFromSelf(1,1,nil))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Normal Summoned/Set. Must be Special Summoned by a card effect. If this card is Special Summoned from the hand or Deck: You can double this card's original ATK/DEF, until the end of the next turn. If this card is Special Summoned from the GY, or if this banished card is Special Summoned: You can target 1 monster your opponent controls; destroy it. You can only use each effect of "Guardragon Andrake" once per turn.
|
--守護竜アンドレイク
--Guardragon Andrake
--scripted by Logical Nonsense
local s,id=GetID()
function s.initial_effect(c)
c:EnableUnsummonable()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--ATK/DEF up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id)
e2:SetCondition(s.atkcon)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--destroy
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+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:GetFirst()==c and c:IsPreviousLocation(LOCATION_HAND|LOCATION_DECK)
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_SET_BASE_ATTACK)
e1:SetValue(c:GetBaseAttack()*2)
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END,2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(c:GetBaseDefense()*2)
c:RegisterEffect(e2)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:GetFirst()==c and c:IsPreviousLocation(LOCATION_GRAVE|LOCATION_REMOVED)
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(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During your opponent's Main Phase: You can discard 1 card; immediately after this effect resolves, Pendulum Summon a Pendulum Monster(s), also for the rest of this turn after this card resolves, cards in your Pendulum Zones cannot activate their effects and cannot be destroyed by your card effects, also, shuffle them into the Deck during the End Phase. You can only activate 1 "Pendulum Encore" per turn.
|
--ペンデュラム・アンコール
--Pendulum Encore
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.pencon)
e1:SetCost(s.pencost)
e1:SetTarget(s.pentg)
e1:SetOperation(s.penop)
c:RegisterEffect(e1)
aux.GlobalCheck(s,function()
s.should_check=false
s.exclude_card=nil
local geff=Effect.CreateEffect(c)
geff:SetType(EFFECT_TYPE_FIELD)
geff:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
geff:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
geff:SetTargetRange(1,1)
geff:SetTarget(function(e,c)
if s.should_check or s.exclude_card then
return c==s.exclude_card or not c:IsType(TYPE_PENDULUM)
end
return false
end)
Duel.RegisterEffect(geff,0)
end)
end
function s.pencon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase()
end
function s.filter(c,tp)
s.exclude_card=c
local res=c:IsDiscardable() and Duel.IsPlayerCanPendulumSummon(tp)
s.exclude_card=nil
return res
end
function s.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==100 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),tp) end
s.should_check=true
local res=Duel.IsPlayerCanPendulumSummon(tp)
s.should_check=nil
return res
end
e:SetLabel(0)
Duel.DiscardHand(tp,s.filter,1,1,REASON_COST|REASON_DISCARD,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA|LOCATION_HAND)
end
function s.addreset(c)
s.should_check=true
local eff=Effect.CreateEffect(c)
eff:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
eff:SetCode(EVENT_CHAIN_END)
eff:SetOperation(function(e) e:Reset() s.should_check=false end)
Duel.RegisterEffect(eff,0)
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
Duel.PendulumSummon(tp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
s.addreset(e:GetHandler())
--indes and can't activate
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_PZONE,0)
e1:SetValue(aux.indsval)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetValue(1)
Duel.RegisterEffect(e2,tp)
--return to deck
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(s.retop)
e3:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if #g>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
The ATK of this card increases by 1000 points whenever it attacks a WIND monster.
|
--空の昆虫兵
--Insect Soldiers of the Sky
local s,id=GetID()
function s.initial_effect(c)
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:SetCondition(s.condtion)
e1:SetValue(1000)
c:RegisterEffect(e1)
end
function s.condtion(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL)
and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil
and Duel.GetAttackTarget():IsFaceup() and Duel.GetAttackTarget():IsAttribute(ATTRIBUTE_WIND)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 1 monsters Once per Chain, if a card or effect activation is negated (except during the Damage Step): You can attach up to 1 card each from your GY and your opponent's GY to this card as material. This card gains effects based on the number of materials attached to it. ● 1+: Gains 700 ATK/DEF for each material attached to it. ● 4+: Cannot be destroyed by battle or card effects. ● 8+: (Quick Effect): You can detach 4 materials from this card; destroy all cards on the field.
|
--怒小児様
--Tantrum Toddler
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon Procedure
Xyz.AddProcedure(c,nil,1,2)
--Attach up to 2 cards to this card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN)
e1:SetTarget(s.atchtg)
e1:SetOperation(s.atchop)
c:RegisterEffect(e1)
--Gains 700 ATK/DEF for each material attached to it
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(function(e,c) return c:GetOverlayCount()*700 end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--Cannot be destroyed by battle
local e4=e2:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>=4 end)
e4:SetValue(1)
c:RegisterEffect(e4)
--Cannot be destroyed by card effects
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
--Destroy all cards on the field
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,0))
e6:SetCategory(CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE)
e6:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e6:SetCondition(function(e) return e:GetHandler():GetOverlayCount()>=8 end)
e6:SetCost(Cost.DetachFromSelf(4,4,nil))
e6:SetTarget(s.destg)
e6:SetOperation(s.desop)
c:RegisterEffect(e6)
end
function s.atchtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.GetFieldGroupCount(0,LOCATION_GRAVE,LOCATION_GRAVE)>0 end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function s.atchop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(0,LOCATION_GRAVE,LOCATION_GRAVE)
local sg=aux.SelectUnselectGroup(g,e,tp,1,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_ATTACH)
if #sg>0 then
Duel.HintSelection(sg,true)
Duel.Overlay(c,sg)
end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
(This card is always treated as a "Kuriboh" card.) When an opponent's monster declares an attack: You can discard this card; add 1 "Kuriboh" monster from your Deck to your hand, except "Kuriboo". Once per turn (Quick Effect): You can discard 1 Trap, then target 1 face-up monster your opponent controls; it loses 1500 ATK until the end of this turn.
|
--クリブー
--Kuriboo
--Scripted by Eerie Code
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_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.thcon)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCost(s.cost)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
s.listed_series={SET_KURIBOH}
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
function s.thfilter(c)
return c:IsSetCard(SET_KURIBOH) and not c:IsCode(id) and c:IsMonster() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.cfilter(c)
return c:IsTrap() and c:IsDiscardable()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.cfilter,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:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,tp,-1500)
end
function s.operation(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:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(-1500)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Special Summon this card (from your hand) by sending 1 Level 4 or lower monster from your hand to the Graveyard. If you do, decrease this card's Level by the Level of that monster. If this card attacks or is attacked, until the end of the Damage Step any effect damage you take becomes 0.
|
--パワー・ジャイアント
--Power Giant
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--decrease damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetOperation(s.damop)
c:RegisterEffect(e3)
end
function s.spfilter(c)
return c:IsLevelBelow(4) and c:IsAbleToGraveAsCost()
end
function s.spcon(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,c)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,1,nil,0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g=nil
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,c)
local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
end
return false
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-g:GetFirst():GetLevel())
e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD))
e:GetHandler():RegisterEffect(e1)
g:DeleteGroup()
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(s.damval)
e1:SetReset(RESET_PHASE|PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE|PHASE_DAMAGE)
Duel.RegisterEffect(e2,tp)
end
function s.damval(e,re,val,r,rp,rc)
if (r&REASON_EFFECT)~=0 then return 0
else return val end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Remove from play all "Morphtronic" monsters from your Graveyard. Target face-up Machine-Type monster you control gains 200 ATK for each card removed, until the End Phase.
|
--百機夜工
--Factory of 100 Machines
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter1(c)
return c:IsSetCard(SET_MORPHTRONIC) and c:IsMonster() and c:IsAbleToRemove() and aux.SpElimFilter(c,true)
end
function s.filter2(c,sg)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and not sg:IsContains(c)
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.filter2(chkc) end
local rg=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
if chk==0 then return #rg>0 and Duel.IsExistingTarget(s.filter2,tp,LOCATION_MZONE,0,1,nil,rg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter2,tp,LOCATION_MZONE,0,1,1,nil,rg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,#rg,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if ct>0 and 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(#g*200)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Look at your Deck, and if you do, you can add 1 monster from your Deck to your hand, whose sum of ATK and DEF equals your LP. You can only activate 1 "Card of the Soul" per turn.
|
--魂のカード
--Card of the Soul
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1: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.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.filter(c,lp)
return c:GetAttack()>=0 and c:GetDefense()>=0 and c:GetAttack()+c:GetDefense()==lp and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if #g<1 then return end
Duel.ConfirmCards(tp,g)
local lp=Duel.GetLP(tp)
if g:IsExists(s.filter,1,nil,lp) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,s.filter,1,1,nil,lp)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
Duel.ShuffleDeck(tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Select 1 face-up monster you control. Send 1 card from your Deck to the Graveyard with the same name as the selected card.
|
--ロスト・ネクスト
--Next to be Lost
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,code)
return c:IsCode(code) and c:IsAbleToGrave()
end
function s.tgfilter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
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.tgfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
An Xyz Monster that was Summoned using this card on the field as material gains this effect. ● If it is Xyz Summoned: It gains 800 ATK.
|
--豪腕特急トロッコロッコ
--Express Train Trolley Olley
local s,id=GetID()
function s.initial_effect(c)
--effect gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(s.efcon)
e1:SetOperation(s.efop)
c:RegisterEffect(e1)
end
function s.efcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end
function s.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.atkcon)
e1:SetOperation(s.atkop)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsXyzSummoned()
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can add 1 Spell/Trap from your Deck to your hand, that mentions "Dark Magician". During your opponent's turn, if you activate a Spell/Trap Card or effect while this card is in your GY (except during the Damage Step): You can Tribute 1 Spellcaster monster; add this card to your hand. You can only use each effect of "Magician's Rod" once per turn.
|
--マジシャンズ・ロッド
--Magician's Rod
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--tohand (self)
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_CHAINING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(s.condition)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
end
s.listed_names={CARD_DARK_MAGICIAN}
function s.thfilter(c)
return c:ListsCode(CARD_DARK_MAGICIAN) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and rp==tp and re:IsSpellTrapEffect()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,false,nil,nil,RACE_SPELLCASTER) end
local sg=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,false,nil,nil,RACE_SPELLCASTER)
Duel.Release(sg,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: Select 1 monster on the field and return it to its owner's hand.
|
--ハネハネ
--Hane-Hane
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a face-up WATER monster you control is destroyed by battle or by a card effect and sent to the Graveyard: Special Summon the monsters destroyed and sent from the field to your Graveyard at that time, then inflict 500 damage to your opponent for each of those Special Summoned monsters. You can only activate 1 "Torrential Reborn" per turn.
|
--激流蘇生
--Torrential Reborn
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_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP)
and c:IsAttribute(ATTRIBUTE_WATER) and (c:GetPreviousAttributeOnField()&ATTRIBUTE_WATER)~=0
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.spfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsControler(tp) 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 ct=eg:FilterCount(s.spfilter,nil,e,tp)
return ct>0 and (ct==1 or not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct
end
Duel.SetTargetCard(eg)
local g=eg:Filter(s.spfilter,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0)
end
function s.spfilter2(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
local sg=eg:Filter(s.spfilter2,nil,e,tp)
if ft<#sg then return end
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Summoned: You can place 1 "Crystal Beast" monster from your hand, Deck, or GY, face-up in your Spell & Trap Zone as a Continuous Spell. If this face-up card is destroyed in a Monster Zone, you can place it face-up in your Spell & Trap Zone as a Continuous Spell, instead of sending it to the GY.
|
--宝玉獣 サファイア・ペガサス
--Crystal Beast Sapphire Pegasus
local s,id=GetID()
function s.initial_effect(c)
--send replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(s.repcon)
e1:SetOperation(s.repop)
c:RegisterEffect(e1)
--place
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
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.repcon(e)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0)
end
function s.filter(c)
return c:IsSetCard(SET_CRYSTAL_BEAST) and not c:IsForbidden()
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|LOCATION_GRAVE|LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You are unaffected by the effects of "Clear World". If this card is Normal or Special Summoned: You can activate this effect; this turn, your monsters that mention "Clear World" can attack directly. You can only use this effect of "Clear Rage Golem" once per turn. When this card inflicts battle damage to your opponent: You can inflict 300 damage to your opponent for each card in their hand.
|
--クリアー・レイジ・ゴーレム
--Clear Rage Golem
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Make your monsters that mention "Clear World" able to attack directly
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e,tp) return (Duel.IsAbleToEnterBP() or Duel.IsBattlePhase()) and Duel.IsTurnPlayer(tp) and not Duel.HasFlagEffect(tp,id) end)
e1:SetOperation(s.diratkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--You are unaffected by the effects of "Clear World"
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CLEAR_WORLD_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
--Inflict 300 damage to your opponent for each card in their hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCondition(function(e,tp,eg,ep) return ep==1-tp end)
e4:SetTarget(s.damtg)
e4:SetOperation(s.damop)
c:RegisterEffect(e4)
end
s.listed_names={CARD_CLEAR_WORLD}
function s.diratkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.HasFlagEffect(tp,id) then return end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
local c=e:GetHandler()
--Your monsters that mention "Clear World" can attact directly this turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(function(e,c) return c:ListsCode(CARD_CLEAR_WORLD) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2))
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)
if chk==0 then return ct>0 end
local dam=ct*300
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 player=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetFieldGroupCount(player,LOCATION_HAND,0)*300
if dam>0 then
Duel.Damage(player,dam,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] Negate the effects of face-up Pendulum Monsters while your opponent controls them. ---------------------------------------- [ Monster Effect ] At the start of the Damage Step, if this card battles a Pendulum Monster: Destroy both that monster and this card.
|
--竜魔王レクターP
--Lector Pendulum, the Dracoverlord
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
Pendulum.AddProcedure(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(s.distg)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
function s.distg(e,c)
return c:IsType(TYPE_PENDULUM)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if chk==0 then return tc and tc:IsFaceup() and tc:IsType(TYPE_PENDULUM) end
local g=Group.FromCards(c,tc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if c:IsRelateToBattle() and tc:IsRelateToBattle() then
local g=Group.FromCards(c,tc)
Duel.Destroy(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control no monsters: Target 1 monster in your GY; Special Summon that target in Attack Position, also, for the rest of this turn after this card resolves, you cannot activate monster effects, except the effects of that Special Summoned monster on the field. You can only activate 1 "Water of Life" per turn.
|
--命いのちの水
--Water of Life
--scripted by Naim
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:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function s.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH)
e1:SetDescription(aux.Stringid(id,1))
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.SpecialSummonComplete()
end
end
function s.aclimit(e,re,tp)
local rc=re:GetHandler()
return re:IsMonsterEffect() and rc:GetFlagEffect(id)==0
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is activated: You can add 1 of your "Icejade" monsters that is banished or in your GY to your hand. Once per turn, if a monster(s) is Normal or Special Summoned (except during the Damage Step): You can target 1 WATER monster you control; that monster, along with any face-up monsters your opponent currently controls, loses ATK equal to the targeted monster's original ATK, until the end of this turn. You can only activate 1 "Icejade Cenote Enion Cradle" per turn.
|
--氷水底イニオン・クレイドル
--Icejade Cenote Enion Cradle
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Decrease ATK
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
s.listed_series={SET_ICEJADE}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED)
end
function s.thfilter(c)
return c:IsMonster() and c:IsSetCard(SET_ICEJADE)
and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) and c:IsAbleToHand()
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(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,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.atkfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
g:AddCard(tc)
g:ForEach(s.op,c,-tc:GetBaseAttack())
end
end
function s.op(tc,c,atk)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can target 1 WATER monster you control; Special Summon from your Deck in Defense Position, 1 Fish monster with the same Level as that monster, but with a different name, and if you do, it cannot activate its effects this turn, also, you cannot Special Summon monsters from the Extra Deck for the rest of this turn, except Xyz Monsters. You can only use this effect of "Buzzsaw Shark" once per turn. If this card is used for the Xyz Summon of a WATER monster, it can be treated as a Level 3 or 5 monster.
|
--カッター・シャーク
--Buzzsaw Shark
--Scripted by Eerie Code and edo9300
local s,id=GetID()
function s.initial_effect(c)
--Special summon 1 fish monster from deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Can be treated as a level 3 or 5 for the Xyz summon of a WATER monster
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_XYZ_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.xyzlv)
c:RegisterEffect(e2)
end
function s.filter(c,e,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function s.spfilter(c,e,tp,tc)
return c:IsRace(RACE_FISH) and c:GetLevel()==tc:GetLevel() and not c:IsCode(tc:GetCode())
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:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) 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_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
--Cannot activate its effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(3302)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESETS_STANDARD_PHASE_END)
sc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
--Cannot special summon from the extra deck for rest of turn, except Xyz monsters
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
ge1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
ge1:SetDescription(aux.Stringid(id,1))
ge1:SetTargetRange(1,0)
ge1:SetTarget(s.splimit)
ge1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(ge1,tp)
--Clock Lizard check
aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter)
end
function s.xyzlv(e,c,rc)
if rc:IsAttribute(ATTRIBUTE_WATER) then
return 5,3,e:GetHandler():GetLevel()
else
return e:GetHandler():GetLevel()
end
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function s.lizfilter(e,c)
return not c:IsOriginalType(TYPE_XYZ)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can make this card's ATK 0, and if you do, Special Summon 1 "Umbral Horror" monster with 0 ATK from your hand.
|
--アンブラル・グール
--Umbral Horror Ghoul
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_UMBRAL_HORROR) and c:GetAttack()==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 e:GetHandler():GetAttack()>0 and 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)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:GetAttack()==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
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:
|
Field Spells on the field cannot be destroyed. Neither player can activate a new Field Spell Card. You can only control 1 "Field Barrier".
|
--フィールドバリア
--Field Barrier
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Prevent destruction
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_FZONE,LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--Prevent activations of other field spells
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(s.filter)
c:RegisterEffect(e3)
end
function s.filter(e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During your Standby Phase: You can banish this card from your Graveyard, then target 2 Level 4 or lower "Predaplant" monsters in your Graveyard; Special Summon them, also, for the rest of this turn, you cannot Special Summon monsters, except Fusion Monsters, nor Normal Summon/Set any monsters.
|
--捕食植物コーディセップス
--Predaplant Cordyceps
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_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end)
e1:SetCost(Cost.SelfBanish)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
s.listed_series={SET_PREDAPLANT}
function s.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(SET_PREDAPLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
local c=e:GetHandler()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,2,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,2,2,c,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetTargetCards(e)
if ft>0 and (#g>0 or (#g>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if #g>ft then g=g:Select(tp,ft,ft,nil) end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
local c=e:GetHandler()
--Cannot Special Summon, except Fusion Monsters, nor Normal Summon/Set any monsters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
--Cannot Special Summon from the Main Deck check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(CARD_EHERO_BLAZEMAN)
e4:SetTargetRange(1,0)
e4:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function s.splimit(e,c)
if c:IsMonster() then
return not c:IsType(TYPE_FUSION)
else
return not c:IsOriginalType(TYPE_FUSION)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 Set card in the Spell & Trap Card Zone; reveal that target, force its activation if it is a Trap Card, then negate its effect if the activation timing is incorrect, and if you do, destroy it. (If it is not a Trap Card, return it face-down.) When this card resolves, shuffle it into the Deck instead of sending it to the Graveyard.
|
--おとり人形
--Bait Doll
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFaceup() then
s.todeckop(c,e)
return
end
if tc:IsTrap() then
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local condition
local cost
local target
local operation
if te then
condition=te:GetCondition()
cost=te:GetCost()
target=te:GetTarget()
operation=te:GetOperation()
end
local chk=te and te:GetCode()==EVENT_FREE_CHAIN and te:IsActivatable(tep)
and (not condition or condition(te,tep,eg,ep,ev,re,r,rp))
and (not cost or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (not target or target(te,tep,eg,ep,ev,re,r,rp,0))
Duel.ChangePosition(tc,POS_FACEUP)
Duel.ConfirmCards(tp,tc)
if chk then
Duel.ClearTargetCard()
e:SetProperty(te:GetProperty())
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
if tc:IsNormalTrap() then
tc:CancelToGrave(false)
end
tc:CreateEffectRelation(te)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if target~=te:GetTarget() then
target=te:GetTarget()
end
if target then target(te,tep,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
for tg in g:Iter() do
tg:CreateEffectRelation(te)
end
if tc:IsHasEffect(EFFECT_REMAIN_FIELD) then
tc:SetStatus(STATUS_LEAVE_CONFIRMED,false)
end
if operation~=te:GetOperation() then
operation=te:GetOperation()
end
if operation then operation(te,tep,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
for tg in g:Iter() do
tg:ReleaseEffectRelation(te)
end
else
if Duel.Destroy(tc,REASON_EFFECT)==0 then
Duel.SendtoGrave(tc,REASON_RULE)
end
end
else
Duel.ConfirmCards(tp,tc)
end
s.todeckop(c,e)
end
function s.todeckop(c,e)
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is in your hand or GY: You can reveal 1 Level 5 or higher monster in your hand, then activate 1 of these effects (but you can only use each effect of "Steel-Stringed Sacrifice" once per turn); during the End Phase of this turn, lose 1000 LP if you did not Normal Summon the revealed monster, or a monster with the same original name, after activating this effect. ● Special Summon this card from your hand. ● Add this card from your GY to your hand. ● Banish this card from your GY, and if you do, add 1 Level 5 or higher monster from your GY to your hand.
|
--
--Steel-Stringed Sacrifice
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Activate 1 of these effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
e1:SetCost(s.effcost)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
end
function s.effcostfilter(c)
return c:IsLevelAbove(5) and not c:IsPublic()
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.effcostfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local rc=Duel.SelectMatchingCard(tp,s.effcostfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,rc)
Duel.ShuffleHand(tp)
e:SetLabelObject(rc)
e:SetLabel(rc:GetOriginalCodeRule())
rc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
function s.thfilter(c)
return c:IsLevelAbove(5) and c:IsAbleToHand()
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=c:IsLocation(LOCATION_HAND) and not Duel.HasFlagEffect(tp,id)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=c:IsLocation(LOCATION_GRAVE) and not Duel.HasFlagEffect(tp,id+1) and c:IsAbleToHand()
local b3=c:IsLocation(LOCATION_GRAVE) and not Duel.HasFlagEffect(tp,id+2)
and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,c)
if chk==0 then return b1 or b2 or b3 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)},
{b3,aux.Stringid(id,4)})
Duel.SetTargetParam(op)
Duel.RegisterFlagEffect(tp,id+op-1,RESET_PHASE|PHASE_END,0,1)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
elseif op==2 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
elseif op==3 then
e:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local code=e:GetLabel()
local rc=e:GetLabelObject()
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,5))
--Register if the player Normal Summons the revealed monster or a monster with the same original name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep) return ep==tp and ((rc:HasFlagEffect(id) and eg:IsContains(rc) and rc:IsFaceup()) or eg:IsExists(aux.FaceupFilter(Card.IsOriginalCodeRule,code),1,nil)) end)
e1:SetOperation(function(e) e:SetLabel(1) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--During the End Phase of this turn, lose 1000 LP if you did not Normal Summon the revealed monster, or a monster with the same original name
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(id,6))
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(function() return e1:GetLabel()==0 end)
e2:SetOperation(function(e,tp) Duel.SetLP(tp,Duel.GetLP(tp)-1000) end)
Duel.RegisterEffect(e2,tp)
if not c:IsRelateToEffect(e) then return end
local op=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if op==1 then
--Special Summon this card from your hand
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
elseif op==2 then
--Add this card from your GY to your hand
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
elseif op==3 then
--Banish this card from your GY, and if you do, add 1 Level 5 or higher monster from your GY to your hand
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)==0 or not c:IsLocation(LOCATION_REMOVED) 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.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot attack the turn it is Summoned. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack your opponent directly. If this card attacks a Defense Position monster, inflict piercing battle damage to your opponent. If this card attacks, your opponent cannot activate any Spell/Trap until the end of the Damage Step.
|
--トゥーン・アンティーク・ギアゴーレム
--Toon Ancient Gear Golem
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_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Direct attack
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetCondition(s.dircon)
c:RegisterEffect(e4)
--Prevent actvations when battling
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetValue(s.aclimit)
e5:SetCondition(s.actcon)
c:RegisterEffect(e5)
--Piercing damage
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_PIERCE)
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.cfilter1(c)
return c:IsFaceup() and c:IsCode(15259703)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_TOON)
end
function s.dircon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(s.cfilter2,tp,0,LOCATION_MZONE,1,nil)
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card cannot attack in the same turn it is Normal Summoned, Flip Summoned, or Special Summoned. During each of your and your opponent's Standby Phases, remove 1 Spell Counter on your side of the field. If you do not, destroy this card.
|
--魔導アーマー エグゼ
--Armor Exe
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: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)
--cost
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_PHASE|PHASE_STANDBY)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(s.ccost)
c:RegisterEffect(e4)
end
s.counter_list={COUNTER_SPELL}
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.ccost(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsCanRemoveCounter(tp,1,0,COUNTER_SPELL,1,REASON_COST) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.RemoveCounter(tp,1,0,COUNTER_SPELL,1,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Neither player can target "Lightsworn" monsters (anywhere) with card effects. During each of your End Phases: Send the top 2 cards of your Deck to the Graveyard.
|
--ライトロード・ドルイド オルクス
--Aurkus, Lightsworn Druid
local s,id=GetID()
function s.initial_effect(c)
--Neither player can target "Lightsworn" monsters (anywhere) with card effects
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(function(_,c) return c:IsSetCard(SET_LIGHTSWORN) and c:IsMonster() and c:IsFaceup() end)
e1:SetValue(1)
c:RegisterEffect(e1)
--Send the top 2 cards of your Deck to the GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end)
e2:SetTarget(s.distg)
e2:SetOperation(function(_,tp) Duel.DiscardDeck(tp,2,REASON_EFFECT) end)
c:RegisterEffect(e2)
end
s.listed_series={SET_LIGHTSWORN}
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters Once per turn: You can detach 1 Xyz Material from this card; change this card's DEF to 0, and if you do, change its ATK to 3000. These changes last until the end of this turn. If this card attacks, it is changed to Defense Position at the end of the Battle Phase. If this card is attacked, change it to Attack Position at the end of the Damage Step if it has no Xyz Materials. You can only control 1 "Number 52: Diamond Crab King".
|
--No.52 ダイヤモンド・クラブ・キング
--Number 52: Diamond Crab King
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--xyz summon
Xyz.AddProcedure(c,nil,4,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(Cost.DetachFromSelf(1))
e1:SetOperation(s.adop)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE|PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.poscon1)
e2:SetOperation(s.posop1)
c:RegisterEffect(e2)
--pos
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(s.poscon2)
e3:SetOperation(s.posop2)
c:RegisterEffect(e3)
end
s.xyz_number=52
function s.adop(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_SET_ATTACK_FINAL)
e1:SetValue(3000)
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e2)
end
end
function s.poscon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetAttackedCount()>0
end
function s.posop1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsAttackPos() then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function s.poscon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget() and e:GetHandler():GetOverlayCount()==0
end
function s.posop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsDefensePos() then
Duel.ChangePosition(c,POS_FACEUP_ATTACK)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can discard 1 Spellcaster-Type monster; draw 1 card. Once per turn, if this card is targeted for an attack: You can target 1 Spellcaster-Type monster in your Graveyard, except "Chocolate Magician Girl"; Special Summon it, then change the attack target to it, and if you do, the attacking monster's ATK becomes half its current ATK.
|
--チョコ・マジシャン・ガール
--Chocolate Magician Girl
local s,id=GetID()
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.drcost)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
--change battle target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.costfilter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsDiscardable()
end
function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.costfilter,1,1,REASON_DISCARD|REASON_COST)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local a=Duel.GetAttacker()
local ag=a:GetAttackableTarget()
if a:CanAttack() and not a:IsImmuneToEffect(e) and ag:IsContains(tc) then
Duel.BreakEffect()
Duel.ChangeAttackTarget(tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(math.ceil(a:GetAttack()/2))
a:RegisterEffect(e1)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned, place 2 counters on it. This card gains 800 ATK for each of these counters on it. If this card would be destroyed by a card effect, remove 1 of this card's counters instead.
|
--メタル・シューター
--Metal Shooter
local s,id=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(0x26)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.addct)
e1:SetOperation(s.addc)
c:RegisterEffect(e1)
--attackup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(s.attackup)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.reptg)
c:RegisterEffect(e3)
end
function s.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x26)
end
function s.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x26,2)
end
end
function s.attackup(e,c)
return c:GetCounter(0x26)*800
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT)
and c:IsCanRemoveCounter(tp,0x26,1,REASON_COST) end
c:RemoveCounter(tp,0x26,1,REASON_EFFECT)
return true
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
All monsters you control gain 1000 ATK while you control 5 or more EARTH monsters. You can only use each of the following effects of "Vernusylph in Full Bloom" once per turn. You can banish 1 "Vernusylph and the Flower Buds" from your hand or GY; Special Summon 1 "Vera the Vernusylph Goddess" from your Deck. If a "Vernusylph" monster(s) is Special Summoned from your GY (except during the Damage Step): You can target 1 monster on the field or in either GY; return it to the hand.
|
--春化精の花盛
--Vernusylph in Full Bloom
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Increase ATK
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(s.atkcon)
e2:SetValue(1000)
c:RegisterEffect(e2)
--Special Summon 1 "Vera, the Vernalizer Fairy Goddess"
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--Return 1 card to the hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,{id,1})
e4:SetCondition(s.thcon)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
end
s.listed_names={63708033,55125728}
s.listed_series={SET_VERNUSYLPH}
function s.atkcon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_EARTH),e:GetHandlerPlayer(),LOCATION_MZONE,0,5,nil)
end
function s.spcostfilter(c)
return c:IsCode(63708033) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsCode(55125728) 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)
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
function s.thconfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_VERNUSYLPH) and c:IsSummonLocation(LOCATION_GRAVE) and c:IsPreviousControler(tp)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.thconfilter,1,nil,tp)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local loc=LOCATION_MZONE|LOCATION_GRAVE
if chkc then return chkc:IsLocation(loc) and chkc:IsMonster() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsMonster,Card.IsAbleToHand),tp,loc,loc,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,aux.AND(Card.IsMonster,Card.IsAbleToHand),tp,loc,loc,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,loc)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then
Duel.ShuffleHand(tc:GetControler())
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Your opponent cannot target "Scareclaw" Link Monsters or "Visas Starfrost" you control with card effects, also they cannot be destroyed by your opponent's card effects. Banish any monster destroyed by battle with a "Scareclaw" Link Monster or "Visas Starfrost" you control. You can banish 1 "Scareclaw" Link Monster from your field or GY, then target 1 card your opponent controls; destroy it. You can only use this effect of "Scareclaw Defanging" once per turn.
|
--界放せし肆世壊
--Scareclaw Defanging
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--"Scareclaw" Link monsters and "Visas Starfrost" cannot be destroyed by opponent's effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(s.cfilter)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--"Scareclaw" Link monsters and "Visas Starfrost" cannot be targeted by opponent's effect
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--Banish any monster destroyed by battle with "Scareclaw" Link Monsters or "Visas Starfrost"
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(s.cfilter)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
--Destroy 1 card the opponent controls
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,id)
e5:SetCost(s.descost)
e5:SetTarget(s.destg)
e5:SetOperation(s.desop)
c:RegisterEffect(e5)
end
s.listed_series={SET_SCARECLAW}
s.listed_names={CARD_VISAS_STARFROST}
function s.cfilter(e,c)
return c:IsCode(CARD_VISAS_STARFROST) or (c:IsSetCard(SET_SCARECLAW) and c:IsLinkMonster())
end
function s.costfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_SCARECLAW) and c:IsLinkMonster() and c:IsAbleToRemoveAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc: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,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is Normal or Special Summoned: You can target 1 Field Spell on the field; destroy it. Once per turn: You can Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters you control as Fusion Materials, including this card.
|
--獄炎のカース・オブ・ドラゴン
--Curse of Dragonfire
local s,id=GetID()
function s.initial_effect(c)
--Destroy a field Spelll
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Perform a Fusion Summon
local params = {nil,Fusion.OnFieldMat,nil,nil,Fusion.ForcedHandler}
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(Fusion.SummonEffTG(table.unpack(params)))
e3:SetOperation(Fusion.SummonEffOP(table.unpack(params)))
c:RegisterEffect(e3)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_FZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc 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:
|
"Sea Koala" + "Tree Otter" You can send 1 Beast-Type monster from your hand to the Graveyard to target 1 monster your opponent controls; destroy it.
|
--コアラッコアラ
--Koalo-Koala
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,87685879,71759912)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cfilter(c)
return c:IsRace(RACE_BEAST) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card attacks while you have no cards in your hand, your opponent cannot activate any Spell or Trap Cards until after the Damage Step.
|
--インフェルニティ・ビースト
--Infernity Beast
local s,id=GetID()
function s.initial_effect(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(s.aclimit)
e1:SetCondition(s.condition)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0 and Duel.GetAttacker()==e:GetHandler()
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent gains LP (except during the Damage Step): You can Special Summon this card from your hand, and if you do, this card's ATK becomes equal to the LP your opponent gained. You can Tribute this card, then target 1 face-up monster you control; it gains 1000 ATK until the end of this turn.
|
--EMライフ・ソードマン
--Performapal Life Swordsman
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_RECOVER)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(Cost.SelfTribute)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=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()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(ev)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You cannot Pendulum Summon monsters, except "Abyss Actor" monsters. This effect cannot be negated. Once per turn: You can target 1 "Abyss Actor" monster you control; this turn, it can make up to 3 attacks on monsters during each Battle Phase, also other monsters you control cannot attack for the rest of this turn (even if this card leaves the field). ---------------------------------------- [ Monster Effect ] Cannot be destroyed by battle during your turn. This card can make up to 3 attacks on monsters during each Battle Phase.
|
--魔界劇団-ティンクル・リトルスター
--Abyss Actor - Twinkle Little Star
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon procedure
Pendulum.AddProcedure(c)
--Cannot Pendulum Summon, except "Abyss Actor" monsters
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,tp,sumtp,sumpos) return not c:IsSetCard(SET_ABYSS_ACTOR) and (sumtp&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end)
c:RegisterEffect(e1)
--Make 1 "Abyss Actor" you control able to attack up to 3 times on monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(function() return Duel.IsAbleToEnterBP() end)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--This card can make up to 3 attacks on monsters during each Battle Phase
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(2)
c:RegisterEffect(e3)
--Cannot be destroyed by battle during your turn
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetCondition(function(e) return Duel.IsTurnPlayer(e:GetHandlerPlayer()) end)
e4:SetValue(1)
c:RegisterEffect(e4)
end
s.listed_series={SET_ABYSS_ACTOR}
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(SET_ABYSS_ACTOR) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_ABYSS_ACTOR),tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_ABYSS_ACTOR),tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local fid=0
if tc:IsRelateToEffect(e) then
fid=tc:GetRealFieldID()
--Can make up to 3 attacks on monsters this turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(2)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
--Other monsters you control cannot attack for the rest of this turn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c) return fid==0 or c:GetRealFieldID()~=fid end)
e2:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e2,tp)
aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2))
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can target 1 of your banished "Six Samurai" monsters; add it to your hand. If exactly 1 "Six Samurai" monster you control (and no other cards) would be destroyed by card effect, you can banish this card from your GY instead.
|
--影六武衆-ゲンバ
--Secret Six Samurai - Genba
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Add 1 banished "Six Samurai" monster to the 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_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Destruction replacement for exactly 1 "Six Samurai" monster
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_SIX_SAMURAI}
function s.thfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_SIX_SAMURAI) and c:IsMonster() 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,nil,REASON_EFFECT)
end
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_SIX_SAMURAI) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() and #eg==1 and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
All face-up monsters you control become Plant monsters. Once per turn, during your Standby Phase, if you do not control a face-up "Naturia Pineapple", and have no monsters in your GY except Plant or Beast: You can Special Summon this card from your GY. You must control no Spells or Traps to activate and resolve this effect.
|
--ナチュル・パイナポー
--Naturia Pineapple
local s,id=GetID()
function s.initial_effect(c)
--Change race
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(RACE_PLANT)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_PHASE|PHASE_STANDBY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsSpellTrap() or (c:IsCode(id) and c:IsFaceup())
end
function s.filter2(c)
return c:IsMonster() and not c:IsRace(RACE_PLANT|RACE_BEAST)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e)
and not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE,0,1,nil) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
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 activate Trap Cards or their effects, except for "Amorphage" cards. 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 Greed
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_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_PZONE)
e4:SetTargetRange(1,1)
e4:SetCondition(s.limcon)
e4:SetValue(s.limval)
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.limcon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_AMORPHAGE),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.limval(e,re,rp)
local rc=re:GetHandler()
return re:IsTrapEffect() and not rc:IsSetCard(SET_AMORPHAGE) and not rc:IsImmuneToEffect(e)
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:
|
Special Summon 1 "Nordic" monster from your Deck, but you cannot Special Summon monsters from the Extra Deck, except "Aesir" monsters, while that monster is face-up on the field. You can banish this card from your GY; add 1 "Nordic" monster from your Deck to your hand, then shuffle 1 card from your hand into the Deck. You can only use 1 "Nordic Relic Hlidskjalf" effect per turn, and only once that turn.
|
--極星宝フリドスキャルヴ
--Nordic Relic Hlidskjalf
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_series={SET_NORDIC,SET_AESIR}
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_NORDIC) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local c=e:GetHandler()
--Cannot Special Summon non-Aesir monsters from Extra Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(SET_AESIR) end)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1,true)
--Lizard check
local e2=aux.createContinuousLizardCheck(c,LOCATION_MZONE,function(_,c) return c:IsOriginalSetCard(SET_AESIR) end)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
end
function s.thfilter(c)
return c:IsSetCard(SET_NORDIC) and c:IsMonster() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if #dg>0 then
Duel.BreakEffect()
Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a monster effect is activated, while you control a "Dinomorphia" card: Pay half your LP; negate the activation, and if you do, destroy that monster, also whenever you take battle damage this turn, the damage taken becomes half your LP at that time. During damage calculation, while your LP are 2000 or less, if you would take battle damage: You can banish this card from your GY; you take no battle damage from that battle. You can only activate 1 "Dinomorphia Intact" per turn.
|
--ダイノルフィア・インタクト
--Dinomorphia Intact
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Negate activation of a monster effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Prevent battle damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.nodamcon)
e2:SetCost(Cost.SelfBanish)
e2:SetOperation(s.nodamop)
c:RegisterEffect(e2)
end
s.listed_series={SET_DINOMORPHIA}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsMonsterEffect() and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_DINOMORPHIA),tp,LOCATION_ONFIELD,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,Duel.GetLP(tp)//2)
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)
local rc=re:GetHandler()
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
--Change battle damage
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(function(e) return Duel.GetLP(e:GetHandlerPlayer())/2 end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Negate the activation and destroy the monster
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.nodamcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=2000 and Duel.GetBattleDamage(tp)>0 and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_AVOID_BATTLE_DAMAGE)
end
function s.nodamop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_AVOID_BATTLE_DAMAGE) then return end
--No battle damage
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can discard 1 card; send 1 Fiend monster from your Deck to the GY. You can send this face-up card from your Spell & Trap Zone to the GY; send "Infernoid" monsters with different names from your hand and/or Deck to the GY, up to the number of monsters your opponent controls that were Special Summoned from the Extra Deck. You can only use 1 "Void Apocalypse" effect per turn, and only once that turn.
|
--煉獄の災天
--Void Apocalypse
--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)
--Send fiend
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCost(s.tgcost)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
--Send infernoid
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id)
e3:SetCost(Cost.SelfToGrave)
e3:SetTarget(s.tgtg2)
e3:SetOperation(s.tgop2)
c:RegisterEffect(e3)
end
s.listed_series={SET_INFERNOID}
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD)
end
function s.tgfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
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.tgfilter2(c)
return c:IsSetCard(SET_INFERNOID) and c:IsMonster() and c:IsAbleToGrave()
end
function s.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter2,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsSummonLocation,tp,0,LOCATION_MZONE,1,nil,LOCATION_EXTRA) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
end
function s.tgop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(Card.IsSummonLocation,tp,0,LOCATION_MZONE,nil,LOCATION_EXTRA)
if ct<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_HAND|LOCATION_DECK,0,1,ct,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn, during your Main Phase, if you control this monster on the field, you can equip it to a face-up monster on your side of the field as an Equip Spell Card, OR unequip the Union equipment and Special Summon this card in face-up Attack Position. While equipped to a monster by this card's effect, that monster will be unaffected by the effects of Spell Cards controlled by your opponent. (1 monster can only be equipped with 1 Union Monster at a time. If the monster that this card is equipped to is destroyed as a result of battle, destroy this card instead.)
|
--メタル化寄生生物-ルナタイト
--Metallizing Parasite - Lunatite
local s,id=GetID()
function s.initial_effect(c)
aux.AddUnionProcedure(c,nil,true)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(aux.IsUnionState)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
end
function s.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsSpellEffect()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card's activation and effect cannot be negated. Choose 1 monster you control whose original Type is Divine-Beast or whose original name is "The Wicked Avatar", "The Wicked Dreadroot", or "The Wicked Eraser", except a monster(s) already affected by "Divine Evolution", and it gains 1000 ATK/DEF, its effect activations and its activated effects cannot be negated, also it gains the following effect. ● When this card declares an attack: You can make your opponent send 1 monster they control to the GY (their choice).
|
--神の進化
--Divine Evolution
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
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:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={21208154,62180201,57793869}
function s.filter(c)
return c:IsFaceup() and (c:IsOriginalRace(RACE_DIVINE) or c:IsOriginalCodeRule(21208154,62180201,57793869))
and c:GetFlagEffect(id)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc then
local c=e:GetHandler()
--Increase ATK/DEF by 1000
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
--Prevent negation
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_INACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
e3:SetValue(s.efilter)
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
tc:RegisterEffect(e4)
--Make the opponent send 1 monster to the GY
local e5=Effect.CreateEffect(tc)
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetTarget(s.tgtg)
e5:SetOperation(s.tgop)
e5:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e5)
if not tc:IsType(TYPE_EFFECT) then
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_ADD_TYPE)
e6:SetValue(TYPE_EFFECT)
e6:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e6)
end
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
end
end
function s.efilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler()==e:GetHandler()
end
function s.tgfilter(c,p)
return Duel.IsPlayerCanSendtoGrave(p,c) and not c:IsType(TYPE_TOKEN)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(tgfilter,1-tp,LOCATION_MZONE,0,1,nil,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_MZONE)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(1-tp,tgfilter,1-tp,LOCATION_MZONE,0,1,1,nil,1-tp)
if #g>0 then
Duel.SendtoGrave(g,REASON_RULE,PLAYER_NONE,1-tp)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Main Phase (Quick Effect): You can Fusion Summon 1 "Dracotail" Fusion Monster from your Extra Deck, using monsters from your hand or field, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Fusion Monsters. If this card is sent to the GY as material for a Fusion Summon: You can Set 1 "Dracotail" Spell/Trap from your Deck, then you can negate the effects of 1 face-up monster your opponent controls. You can only use each effect of "Dracotail Mululu" once per turn.
|
--星辰竜ムルル
--Dracotail Mululu
--scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Fusion Summon 1 "Dragontail" Fusion Monster from your Extra Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,id)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetTarget(Fusion.SummonEffTG(aux.FilterBoolFunction(Card.IsSetCard,SET_DRACOTAIL)))
e1:SetOperation(s.fusop)
c:RegisterEffect(e1)
--Set 1 "Dragontail" Spell/Trap from your Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and (r&REASON_FUSION)==REASON_FUSION end)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
s.listed_series={SET_DRACOTAIL}
function s.fusop(e,tp,eg,ep,ev,re,r,rp)
Fusion.SummonEffOP(aux.FilterBoolFunction(Card.IsSetCard,SET_DRACOTAIL))(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--You cannot Special Summon from the Extra Deck for the rest of this turn, except Fusion Monsters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--"Clock Lizard" check
aux.addTempLizardCheck(c,tp,function(c) return not c:IsOriginalType(TYPE_FUSION) end)
end
function s.setfilter(c)
return c:IsSetCard(SET_DRACOTAIL) and c:IsSpellTrap() and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetPossibleOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_MZONE)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g==0 or Duel.SSet(tp,g)==0 then return end
local ng=Duel.GetMatchingGroup(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,nil)
if #ng==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,3)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
local sc=ng:Select(tp,1,1,nil):GetFirst()
if sc then
Duel.HintSelection(sc)
sc:NegateEffects(e:GetHandler())
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 EARTH Tuner + 1+ non-Tuner monsters When this card destroys an opponent's monster by battle and sends it to the GY: You can Special Summon that monster to your field in Defense Position.
|
--ゴヨウ・ガーディアン
--Goyo Guardian
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_EARTH),1,1,Synchro.NonTuner(nil),1,99)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCondition(aux.bdogcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetTargetCard(bc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,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
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: Special Summon 3 "Chewbone Jr. Tokens" (Zombie-Type/EARTH/Level 1/ATK 100/DEF 300) to your opponent's field in Defense Position.
|
--チュウボーン
--Chewbone
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_names={7392746}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<3
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,100,300,1,RACE_ZOMBIE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE,1-tp) then return end
for i=1,3 do
local token=Duel.CreateToken(tp,id+1)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is activated: Fusion Summon 1 "Gem-Knight" Fusion Monster from your Extra Deck, using monsters from your Deck as Fusion Material, but change its ATK/DEF to 0. If this card leaves the field, destroy that monster. Once per turn: You can discard 1 Spell; the monster Special Summoned by this card's effect gains ATK/DEF equal to its original ATK/DEF, until the end of your opponent's turn. You can only activate 1 "Brilliant Fusion" per turn.
|
--ブリリアント・フュージョン
--Brilliant Fusion
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Fusion.CreateSummonEff(c,aux.FilterBoolFunction(Card.IsSetCard,SET_GEM_KNIGHT),aux.FALSE,s.extrafil,nil,nil,s.stage2,nil,nil,nil,nil,nil,nil,nil,s.extratg)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.atkcon)
e3:SetCost(s.atkcost)
e3:SetTarget(s.atktg)
e3:SetOperation(s.atkop)
c:RegisterEffect(e3)
end
s.listed_series={SET_GEM_KNIGHT}
function s.extrafil(e,tp,mg1)
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToGrave),tp,LOCATION_DECK,0,nil)
end
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK)
end
function s.stage2(e,tc,tp,sg,chk)
if chk==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT|(RESETS_STANDARD&~RESET_TOFIELD))
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
end
if chk==1 then
e:GetHandler():SetCardTarget(tc)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFirstCardTarget()
end
function s.cfilter(c)
return c:IsSpell() and c:IsDiscardable()
end
function s.atkcost(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,nil)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFirstCardTarget() end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=e:GetHandler():GetFirstCardTarget()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_OPPO_TURN)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(tc:GetBaseDefense())
tc:RegisterEffect(e2)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a Spell/Trap Card, or monster effect, is activated while you control a "Code Talker" monster: Negate the activation, and if you do, banish that card, and if you do, your opponent cannot activate cards, or effects of cards, with the same original name as that card that was banished by this effect, until the end of the next turn. You can only activate 1 "Cynet Conflict" per turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--サイバネット・コンフリクト
--Cynet Conflict
--Script by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_CODE_TALKER}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_CODE_TALKER),tp,LOCATION_MZONE,0,1,nil)
and (re:IsMonsterEffect() or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
local relation=rc:IsRelateToEffect(re)
if chk==0 then return rc:IsAbleToRemove(tp)
or (not relation and Duel.IsPlayerCanRemove(tp)) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if relation then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,rc:GetControler(),rc:GetLocation())
else
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,0,rc:GetPreviousLocation())
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ec=re:GetHandler()
if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
ec:CancelToGrave()
Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(ec:GetOriginalCode())
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END,2)
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,1))
e2:SetReset(RESET_PHASE|PHASE_END,2)
e2:SetTargetRange(0,1)
Duel.RegisterEffect(e2,tp)
end
end
function s.aclimit(e,re,tp)
return re:GetHandler():GetOriginalCode()==e:GetLabel()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Declare a Level between 1 and 12; your opponent banishes 1 monster of that Level from their Extra Deck. If your opponent does not have a monster of that Level in their Extra Deck, you discard 1 card.
|
--エクストラゲート
--Extra Gate
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=0
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp)
Duel.SetTargetParam(lv)
end
function s.filter(c,lv)
return c:GetLevel()==lv
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(s.filter,1-tp,LOCATION_EXTRA,0,nil,lv)
if #g~=0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local rg=g:FilterSelect(1-tp,Card.IsAbleToRemove,1,1,nil)
if #rg~=0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
else
local cg=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0)
Duel.ConfirmCards(tp,cg)
end
else
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When an attack is declared involving another Plant monster you control: You can Tribute this card from your hand or face-up field; that monster you control gains 1000 ATK/DEF until the end of this turn. If a Plant monster(s) you control is Tributed, while this card is in your GY (except during the Damage Step): You can Special Summon this card in Defense Position, but banish it when it leaves the field. You can only use each effect of "Erica the Rikka Fairy" once per turn.
|
--六花精エリカ
--Erica the Rikka Fairy
--Scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Making your battling plant monster gain 1000 ATK/DEF
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE|LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.atkcon)
e1:SetCost(Cost.SelfTribute)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--Special summon itself from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc~=e:GetHandler() and tc:IsFaceup() and tc:IsControler(tp) and tc:IsRace(RACE_PLANT)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
function s.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:GetPreviousRaceOnField()&RACE_PLANT==RACE_PLANT
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spcfilter,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,POS_FACEUP_DEFENSE) and c:IsLocation(LOCATION_GRAVE) and not eg:IsContains(c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_GRAVE)
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:
|
You can Special Summon this card (from your hand). You can only Special Summon "Dynatherium" once per turn this way. If Summoned this way: Activate this effect; your opponent can Special Summon 1 Level 4 monster from either GY. * The above text is unofficial and describes the card's functionality in the OCG.
|
--俊足なカバ バリキテリウム
--Dynatherium
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--special summon when summoned
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_SPSUMMON_SUCCESS)
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL+1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_EITHER,LOCATION_GRAVE)
end
function s.filter(c,e,tp)
return c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,1-tp,false,false)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),0,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp)
if #g>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg=g:Select(1-tp,1,1,nil)
Duel.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 "Visas Starfrost" in your Monster Zone and 1 Effect Monster your opponent controls; negate that opponent's monster's effects, and if you do, your targeted monster gains ATK equal to half the original ATK or DEF of that monster (whichever is higher). You can banish this card from your GY; add 1 Spell/Trap that mentions "Visas Starfrost" from your Deck to your hand, except "Trivikarma". You can only use 1 "Trivikarma" effect per turn, and only once that turn.
|
--トリヴィカルマ
--Trivikarma
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Negate target's effect and increase the ATK of "Visas Starfrost"
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.StatChangeDamageStepCondition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Search 1 card that lists "Visas Starfrost"
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_names={CARD_VISAS_STARFROST,id}
function s.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
and ((c:IsCode(CARD_VISAS_STARFROST) and c:IsControler(tp))
or (c:IsControler(1-tp) and c:IsType(TYPE_EFFECT) and c:IsNegatableMonster()))
end
function s.rescon(sg,e,tp,mg)
return sg:FilterCount(Card.IsControler,nil,tp)==1
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local rg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
if chk==0 then return aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,0) end
local tg=aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET)
Duel.SetTargetCard(tg)
local hg=tg:Filter(Card.IsControler,nil,tp)
e:SetLabelObject(hg:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tg:Filter(Card.IsControler,nil,1-tp),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,hg,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g==0 then return end
local tc1=g:GetFirst()
local tc2=g:GetNext()
if tc2==e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc2 and tc2:IsControler(1-tp) and tc2:IsFaceup() and tc2:IsCanBeDisabledByEffect(e) then
local c=e:GetHandler()
Duel.NegateRelatedChain(tc2,RESET_TURN_SET)
--Negate the effects of the opponent's monster
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc2:RegisterEffect(e1)
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)
tc2:RegisterEffect(e2)
local val=math.max(tc2:GetBaseAttack(),tc2:GetBaseDefense())/2
if val==0 then return end
--Your monster gains half of the original ATK/DEF (whichever is higher)
if tc1 and tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and tc1:IsFaceup() then
tc1:UpdateAttack(val,RESET_EVENT|RESETS_STANDARD,c)
end
end
end
function s.thfilter(c)
return c:ListsCode(CARD_VISAS_STARFROST) and c:IsSpellTrap() and c:IsAbleToHand() and not c:IsCode(id)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If only your opponent controls a monster, or if you control a LIGHT monster, you can Normal Summon this card without Tributing. If this card is Normal or Special Summoned: You can Special Summon 1 Level 5 LIGHT Warrior monster from your hand. You can only use this effect of "Hayate the Earth Star" once per turn. Once per turn, when your Warrior monster is targeted for an attack: You can make this card lose exactly 500 ATK, and if you do, negate the attack.
|
--地翔星ハヤテ
--Hayate the Earth Star
local s,id=GetID()
function s.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--negate attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.condition)
e4:SetOperation(s.operation)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function s.ntcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and ((Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0) or Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil))
end
function s.filter1(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsLevel(5) and c:IsAttribute(ATTRIBUTE_LIGHT) 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.filter1,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.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.filter2(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRACE(RACE_WARRIOR)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainDisablable(ev)
and tgp~=tp and re:IsMonsterEffect() and loc==LOCATION_MZONE and eg:IsExists(s.filter2,1,nil,tp)
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)
local c=e:GetHandler()
if c:IsFacedown() or c:GetAttack()<500 or not c:IsRelateToEffect(e) or Duel.GetCurrentChain()~=ev+1 or c:IsStatus(STATUS_BATTLE_DESTROYED) then
return
end
if Duel.NegateActivation(ev) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
c:RegisterEffect(e1)
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return d and d:IsControler(tp) and d:IsFaceup() and d:IsRace(RACE_WARRIOR)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or c:GetAttack()<500 or not c:IsRelateToEffect(e) or c:IsStatus(STATUS_BATTLE_DESTROYED) then
return
end
if Duel.NegateAttack() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is in your hand or GY: You can banish 2 other Cyberse monsters from your hand and/or face-up from your field; Special Summon this card, but its ATK becomes halved. You can only use this effect of "Dual Assembwurm" once per turn. Once per turn: You can banish 1 card from your hand; banish 1 monster on the field with ATK less than or equal to this card's.
|
--デュアル・アセンブルム
--Dual Assembwurm
local s,id=GetID()
function s.initial_effect(c)
--Special Summon this card, but its ATK becomes halved
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Banish 1 monster on the field with ATK less than or equal to this card's
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(s.rmcost)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
end
function s.spcostfilter(c)
return c:IsRace(RACE_CYBERSE) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,e:GetHandler())
if chk==0 then return #rg>=2 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,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
--Its ATK becomes halved
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(c:GetAttack()/2))
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.rmfilter(c,atk)
return c:IsAttackBelow(atk) and c:IsFaceup() and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e:GetHandler():GetAttack()) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_EITHER,LOCATION_MZONE)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,c:GetAttack())
if #g>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can only control 1 "Noble Arms of Destiny". Equip only to a Warrior-Type monster. Once per turn, the equipped monster cannot be destroyed by battle or by card effects. If this face-up card on the field is destroyed and sent to the Graveyard: You can target 1 Warrior-Type "Noble Knight" monster you control; equip this card to that target. You can only use this effect of "Noble Arms of Destiny" once per turn.
|
--天命の聖剣
--Noble Arms of Destiny
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR))
--cannot be destroyed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetValue(s.valcon)
e2:SetCountLimit(1)
c:RegisterEffect(e2)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,id)
e4:SetCondition(s.eqcon)
e4:SetTarget(s.eqtg)
e4:SetOperation(s.eqop)
c:RegisterEffect(e4)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
Duel.Equip(tp,c,tc)
end
end
function s.valcon(e,re,r,rp)
return (r&REASON_BATTLE+REASON_EFFECT)~=0
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp)
end
function s.eqfilter2(c)
return c:IsFaceup() and c:IsSetCard(SET_NOBLE_KNIGHT) and c:IsRace(RACE_WARRIOR)
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.eqfilter2(chkc) end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You cannot Special Summon monsters from the Extra Deck, except Synchro Monsters. You can only use 1 of the following effects of "Blackwing - Zonda the Dusk" per turn, and only once that turn. If this card is Normal or Special Summoned: You can target 1 monster on the field; return it to the hand. You can banish this card from your GY; Special Summon 1 Level 5 or higher "Blackwing" monster from your hand or Deck, then take damage equal to its ATK.
|
--BF-刻夜のゾンダ
--Blackwing - Zonda the Dusk
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Cannot Special Summon monsters from Extra Deck, except Synchro Monsters
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_SYNCHRO) end)
c:RegisterEffect(e1)
--Lizard check
aux.addContinuousLizardCheck(c,LOCATION_MZONE,function(_,c) return not c:IsOriginalType(TYPE_SYNCHRO) end)
--Return 1 monster to the hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Special Summon 1 Level 5 or higher "Blackwing" monster
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id)
e4:SetCost(Cost.SelfBanish)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
end
s.listed_series={SET_BLACKWING}
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_BLACKWING) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 and sc:IsAttackAbove(1) then
Duel.BreakEffect()
Duel.Damage(tp,sc:GetAttack(),REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send 1 Tuner and 1 non-Tuner from your face-up field to the GY; Special Summon both of the following monsters from your Extra Deck. ● 1 Synchro Monster that could be Synchro Summoned using just those 2 monsters in the GY as material. ● 1 Fusion Monster that could be Fusion Summoned using just those 2 monsters in the GY as material. You cannot Special Summon from the Extra Deck the turn you activate this card, except Fusion or Synchro Monsters. You can only activate 1 "Harmonic Synchro Fusion" per turn.
|
--異界共鳴-シンクロ・フュージョン
--Harmonic Synchro Fusion
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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
function s.counterfilter(c)
return not (c:IsSummonLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION|TYPE_SYNCHRO))
end
function s.cfilter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() and not c:IsOriginalType(TYPE_TRAP)
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE,0,1,c,e,tp,c)
end
function s.cfilter2(c,e,tp,tun)
if not (c:IsFaceup() and not c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() and not c:IsOriginalType(TYPE_TRAP)) then return false end
local g=Group.FromCards(tun,c)
for tc in g:Iter() do
tc:AssumeProperty(ASSUME_CODE,tc:GetOriginalCodeRule())
tc:AssumeProperty(ASSUME_TYPE,tc:GetOriginalType())
tc:AssumeProperty(ASSUME_LEVEL,tc:GetOriginalLevel())
tc:AssumeProperty(ASSUME_ATTRIBUTE,tc:GetOriginalAttribute())
tc:AssumeProperty(ASSUME_RACE,tc:GetOriginalRace())
tc:AssumeProperty(ASSUME_ATTACK,tc:GetTextAttack())
tc:AssumeProperty(ASSUME_DEFENSE,tc:GetTextDefense())
end
local chk=Duel.GetLocationCountFromEx(tp,tp,g,TYPE_FUSION)>=2
and Duel.IsExistingMatchingCard(s.fusfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
and Duel.IsExistingMatchingCard(s.syncfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
Duel.AssumeReset()
return chk
end
function s.fusfilter(c,e,tp,mg)
if not (c:IsFacedown() and c:IsType(TYPE_FUSION) and (not c.material_location or (c.material_location&LOCATION_GRAVE)>0)) then return false end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:CheckFusionMaterial(mg)
end
function s.syncfilter(c,e,tp,mg)
if not (c:IsFacedown() and c:IsType(TYPE_SYNCHRO)) then return false end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSynchroSummonable(nil,mg)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
and Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tun=Duel.SelectMatchingCard(tp,s.cfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local nt=Duel.SelectMatchingCard(tp,s.cfilter2,tp,LOCATION_MZONE,0,1,1,tun,e,tp,tun):GetFirst()
local g=Group.FromCards(tun,nt)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetCard(g)
local c=e:GetHandler()
--Cannot Special Summon from the Extra Deck, except Fusion and Synchro 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:SetTargetRange(1,0)
e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION|TYPE_SYNCHRO) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Clock Lizard check
aux.addTempLizardCheck(c,tp,function(_,c) return not c:IsOriginalType(TYPE_FUSION|TYPE_SYNCHRO) end)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetTargetCards(e)
if #mg~=2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCountFromEx(tp,tp,mg,TYPE_FUSION)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fc=Duel.SelectMatchingCard(tp,s.fusfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg):GetFirst()
if not fc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.syncfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg):GetFirst()
if not sc then return end
local g=Group.FromCards(fc,sc)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Reveal 1 "Number" Xyz Monster in your Extra Deck that has a number between "101" and "107" in its name; add 1 monster from your Deck to your hand with the same Type or Attribute as that monster, and the same Level as that monster's Rank, then place 1 card from your hand on top of the Deck, also for the rest of this turn after this card resolves, you cannot Special Summon from the Extra Deck, except Xyz Monsters. You can only activate 1 "Seventh Tachyon" per turn.
|
--時空の七皇
--Seventh Tachyon
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
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_NUMBER}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(-1)
return true
end
function s.revfilter(c,tp)
if not (c:IsSetCard(SET_NUMBER) and not c:IsPublic() and c:IsType(TYPE_XYZ)) then return false end
local number=c.xyz_number
return number and number>=101 and number<=107 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetRace(),c:GetAttribute(),c:GetRank())
end
function s.thfilter(c,race,attr,rank)
return (c:IsRace(race) or c:IsAttribute(attr)) and c:IsLevel(rank) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=e:GetLabel()==-1 and Duel.IsExistingMatchingCard(s.revfilter,tp,LOCATION_EXTRA,0,1,nil,tp)
e:SetLabel(0)
return res
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local rc=Duel.SelectMatchingCard(tp,s.revfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp):GetFirst()
e:SetLabel(rc:GetRace(),rc:GetAttribute(),rc:GetRank())
Duel.ConfirmCards(1-tp,rc)
Duel.ShuffleExtra(tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local race,attr,rank=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,race,attr,rank):GetFirst()
if sc and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoDeck(g,nil,SEQ_DECKTOP,REASON_EFFECT)
end
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local c=e:GetHandler()
--Cannot Special Summon from the Extra Deck, except Xyz Monsters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Clock Lizard check
aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalType(TYPE_XYZ) end)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent's monster effect is activated (Quick Effect): You can Tribute 1 "Naturia" monster and this card; negate the activation, and if you do, destroy that card.
|
--ナチュル・サンフラワー
--Naturia Sunflower
local s,id=GetID()
function s.initial_effect(c)
--Negate effect activation
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.discon)
e1:SetCost(aux.CostWithReplace(s.discost,CARD_NATURIA_CAMELLIA))
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
end
s.listed_series={SET_NATURIA}
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsMonsterEffect()
and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)~=LOCATION_DECK and Duel.IsChainNegatable(ev)
end
function s.cfilter(c)
return c:IsSetCard(SET_NATURIA) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,c) end
local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,c)
Duel.Release(g:AddCard(c),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)
local rc=re:GetHandler()
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 monsters with different names When an effect of another card on the field is activated (Quick Effect): You can Set 1 "Artifact" monster from your hand or Deck to your Spell & Trap Zone as a Spell, but destroy it during your opponent's next End Phase. During your opponent's turn, if this Link Summoned card is destroyed: You can Special Summon 1 "Artifact" monster from your GY in Defense Position. You can only use each effect of "Artifact Dagda" once per turn.
|
--アーティファクト-ダグザ
--Artifact Dagda
--scripted by Logical Nonsense
local s,id=GetID()
function s.initial_effect(c)
--Must be properly summoned before reviving
c:EnableReviveLimit()
Link.AddProcedure(c,nil,2,2,s.matfilter)
--Card/effect on the field is activated, set an "Artifact" from hand/deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id)
e1:SetCondition(s.setcon)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
--Special summon 1 "Artifact" monster from GY in defense position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_series={SET_ARTIFACT}
--Monsters with different names
function s.matfilter(g,lc,sumtype,tp)
return g:CheckDifferentProperty(Card.GetCode,lc,sumtype,tp)
end
--"Artifact" monster that can be set as a spell
function s.setfilter(c)
return c:IsSetCard(SET_ARTIFACT) and c:IsMonster() and c:IsSSetable(true)
end
--If the card/effect (other than this card) was activated on the field
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return (loc&LOCATION_ONFIELD)~=0 and re:GetHandler()~=e:GetHandler() and re:GetHandler()~=e:GetHandler()
end
--Activation legality
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end
end
--If a card/effect on the field is activated, set an "Artifact" from hand/deck, but destroy it later
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil)
if #g>0 then
local c=e:GetHandler()
local tc=g:GetFirst()
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
if Duel.IsPhase(PHASE_END) and Duel.IsTurnPlayer(1-tp) then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_OPPO_TURN,2)
else
e1:SetLabel(0)
e1:SetReset(RESETS_STANDARD_PHASE_END|RESET_OPPO_TURN)
end
Duel.RegisterEffect(e1,tp)
tc:CreateEffectRelation(e1)
end
end
--Check for flag
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.IsTurnPlayer(1-tp) and Duel.GetTurnCount()~=e:GetLabel() and tc:IsRelateToEffect(e)
end
--Destroy the set "Artifact" card
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--If this link summoned card is destroyed during opponent's turn
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsLinkSummoned() and Duel.GetTurnPlayer()~=tp
end
--Check for "Artifact" monster
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_ARTIFACT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
--Activation legality
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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
--Special summon 1 "Artifact" monster from GY in defense position
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
As long as this card remains face-up on the field, increase the ATK of all EARTH monsters by 500 points and decrease the ATK of all WIND monsters by 400 points.
|
--ミリス・レディエント
--Milus Radiant
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTarget(s.tg1)
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetTarget(s.tg2)
e2:SetValue(-400)
c:RegisterEffect(e2)
end
function s.tg1(e,c)
return c:IsAttribute(ATTRIBUTE_EARTH)
end
function s.tg2(e,c)
return c:IsAttribute(ATTRIBUTE_WIND)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If a face-up Xyz Monster you control leaves the field by card effect: You can target 1 Effect Monster your opponent controls; neither player can activate that Effect Monster's effects on the field this turn. You can send this face-up card to the GY; activate 1 "Great Sand Sea - Gold Golgonda" directly from your Deck or GY. You can only use each effect of "Springans Booty" once per turn.
|
--スプリガンズ・ブーティー
--Springans Booty
--Logical Nonsense
--Substitute ID
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Make 1 of opponent's monsters unable to activate its effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.atrfilter,1,nil,tp,rp) end)
e1:SetTarget(s.catg)
e1:SetOperation(s.caop)
c:RegisterEffect(e1)
--Activate 1 "Great Sea Sand – Gold Golgonda" from deck or GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCost(Cost.SelfToGrave)
e2:SetTarget(s.actg)
e2:SetOperation(s.acop)
c:RegisterEffect(e2)
end
s.listed_names={60884672} --"Great Sea Sand – Gold Golgonda"
function s.atrfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsType(TYPE_XYZ) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT)
end
function s.catg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsType(TYPE_EFFECT) end
if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO)
local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,0,LOCATION_MZONE,1,1,nil)
end
function s.caop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
--Cannot activate its effects
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3302)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1,true)
end
end
function s.filter(c,tp)
return c:IsCode(60884672) and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
end
function s.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,tp) end
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
if tc:IsFieldSpell() then
Duel.ActivateFieldSpell(tc,e,tp,eg,ep,ev,re,r,rp)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then
cost(te,tep,eg,ep,ev,re,r,rp,1)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If your opponent controls 2 or more monsters, you can Normal Summon this card without Tributing. If you control "Panther Shark", you can Special Summon this card (from your hand). You can only control 1 "Eagle Shark".
|
--イーグル・シャーク
--Eagle Shark
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetCondition(s.spcon)
c:RegisterEffect(e2)
end
s.listed_names={70101178}
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>1
end
function s.filter(c)
return c:IsFaceup() and c:IsCode(70101178)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2+ Level 4 monsters For each material this card has, monsters you control gain 100 ATK and monsters your opponent controls lose 100 ATK. You can only use each of the following effects of "Ryzeal Duo Drive" once per turn. If this card is Special Summoned: You can attach 1 "Ryzeal" monster from your GY to this card as material. During your Main Phase: You can detach 2 materials from a monster(s) you control, and if you do, add 2 "Ryzeal" cards with different names from your Deck to your hand.
|
--ライゼオル・デュオドライブ
--Ryzeal Duo Drive
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure: 2+ Level 4 monsters
Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats)
--For each material attached to this card, monsters you control gain 100 ATK and monsters your opponent controls lose 100 ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(function(e,c) return (c:IsControler(e:GetHandlerPlayer()) and 100 or -100)*e:GetHandler():GetOverlayCount() end)
c:RegisterEffect(e1)
--Attach 1 "Ryzeal" monster from your GY to this card as material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.attachtg)
e2:SetOperation(s.attachop)
c:RegisterEffect(e2)
--Detach 2 materials from monster(s) you control, and if you do, add 2 "Ryzeal" cards with different names from your Deck to your hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,{id,1})
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_series={SET_RYZEAL}
function s.attachfilter(c,xyzc,tp)
return c:IsSetCard(SET_RYZEAL) and c:IsMonster() and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT)
end
function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function s.attachop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_GRAVE,0,1,1,nil,c,tp):GetFirst()
if tc then
Duel.HintSelection(tc)
Duel.Overlay(c,tc)
end
end
function s.thfilter(c)
return c:IsSetCard(SET_RYZEAL) and c:IsAbleToHand()
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 Duel.CheckRemoveOverlayCard(tp,1,0,2,REASON_EFFECT)
and #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.RemoveOverlayCard(tp,1,0,2,2,REASON_EFFECT)==2 then
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if #g<2 then return end
local thg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_ATOHAND)
if #thg>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Add 1 "Gather Your Mind" card from your Deck to your hand. Your Deck is then shuffled. You can only use 1 "Gather Your Mind" per turn.
|
--精神統一
--Gather Your Mind
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsCode(id) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.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:
|
This Defense Position card cannot be destroyed by battle. You can only use each of the following effects of "Gouki Guts" once per turn. ● During your Main Phase: You can make all "Gouki" monsters you control gain 200 ATK. ● If this card is sent from the field to the GY: You can add 1 "Gouki" card from your Deck to your hand, except "Gouki Guts".
|
--剛鬼ガッツ
--Gouki Guts
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(s.incon)
e1:SetValue(1)
c:RegisterEffect(e1)
--atk increase
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_names={id}
s.listed_series={SET_GOUKI}
function s.incon(e)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENSE)
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_GOUKI) and c:IsMonster()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(200)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.thfilter(c)
return c:IsSetCard(SET_GOUKI) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn, before damage calculation, if your monster attacked an opponent's monster: You can change the battle position of that monster your opponent controls. Once per turn, before damage calculation, if an opponent's monster attacked your monster: You can change the battle position of that monster you control.
|
--カブキ・ドラゴン
--Kabuki Dragon
local s,id=GetID()
function s.initial_effect(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.postg)
e1:SetOperation(s.posop)
c:RegisterEffect(e1)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local d=Duel.GetAttackTarget()
if chk==0 then return d and d:GetControler()~=Duel.GetAttacker():GetControler() and d:IsCanChangePosition() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,d,1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d:IsRelateToBattle() then
Duel.ChangePosition(d,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 "Magistus" monster you control; equip it with 1 "Magistus" monster, except a Level 4 monster, from your Extra Deck, GY, or face-up field. If you have at least 1 each "Magistus" Fusion, Synchro, Xyz, and Link Monsters in your GY, you can equip it with 1 non-"Magistus" Fusion, Synchro, Xyz, or Link Monster from your Extra Deck, instead. You can only activate "Magistus Theurgy" once per turn.
|
--大いなる魔導
--Magistus Theurgy
--Scripted by Naim
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:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_MAGISTUS}
function s.tgfilter(c,tp,check)
return c:IsFaceup() and c:IsSetCard(SET_MAGISTUS) and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_EXTRA|LOCATION_MZONE|LOCATION_GRAVE,0,1,c,check)
end
function s.eqfilter(c,check)
return not c:IsForbidden() and c:IsMonster()
and ((check and c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_EXTRA)) or (c:IsSetCard(SET_MAGISTUS) and not c:IsLevel(4)))
end
function s.chkfilter(c,typ)
return c:IsMonster() and c:IsSetCard(SET_MAGISTUS) and c:IsType(typ)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local check=Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_FUSION)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_SYNCHRO)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_XYZ)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_LINK)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,tp,check) end
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(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,check)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local check=Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_FUSION)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_SYNCHRO)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_XYZ)
and Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_GRAVE,0,1,nil,TYPE_LINK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_EXTRA|LOCATION_MZONE|LOCATION_GRAVE,0,1,1,tc,check)
local eq=g:GetFirst()
if eq then
Duel.Equip(tp,eq,tc,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(tc)
eq: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:
|
[ Pendulum Effect ] If a face-up "Performage" monster(s) you control is destroyed by battle or card effect: You can Special Summon this card from your Pendulum Zone, then take 500 damage. You can only use this effect of "Performage Plushfire" once per turn. ---------------------------------------- [ Monster Effect ] If this card on the field is destroyed by battle or card effect: You can Special Summon 1 "Performage" monster from your hand or Deck, except "Performage Plushfire". You can only use this effect of "Performage Plushfire" once per turn.
|
--Emヒグルミ
--Performage Plushfire
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon procedure
Pendulum.AddProcedure(c)
--Special Summon this card from your Pendulum Zone, then take 500 damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.selfspcon)
e1:SetTarget(s.selfsptg)
e1:SetOperation(s.selfspop)
c:RegisterEffect(e1)
--Special Summon 1 "Performage" monster from your hand or Deck, except "Performage Plushfire"
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and r&(REASON_BATTLE|REASON_EFFECT)>0 end)
e2:SetTarget(s.hdsptg)
e2:SetOperation(s.hdspop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PERFORMAGE}
s.listed_names={id}
function s.selfspconfilter(c,tp)
return c:IsPreviousSetCard(SET_PERFORMAGE) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and c:IsReason(REASON_BATTLE|REASON_EFFECT)
end
function s.selfspcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.selfspconfilter,1,nil,tp)
end
function s.selfsptg(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)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500)
end
function s.selfspop(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
Duel.BreakEffect()
Duel.Damage(tp,500,REASON_EFFECT)
end
end
function s.hdspfilter(c,e,tp)
return c:IsSetCard(SET_PERFORMAGE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
end
function s.hdsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.hdspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
end
function s.hdspop(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.hdspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 face-up monster on the field; equip it with all Equip Cards on the field. If any of those Equip Cards is now equipped to an incorrect target, destroy that Equip Card.
|
--力の集約
--Collected Power
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local dg=Group.CreateGroup()
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),tp,LOCATION_SZONE,LOCATION_SZONE,nil)
for ec in g:Iter() do
if tc:IsFaceup() and tc:IsRelateToEffect(e) and ec:CheckEquipTarget(tc) then
Duel.Equip(tp,ec,tc,false,false)
else
dg:AddCard(ec)
end
end
Duel.EquipComplete()
Duel.Destroy(dg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
After damage calculation, when this card battles an opponent's monster: You can banish that monster, also banish this card.
|
--異次元の女戦士
--D.D. Warrior Lady
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)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local t=Duel.GetAttackTarget()
if chk==0 then
return (t==c and a:IsAbleToRemove())
or (a==c and t~=nil and t:IsAbleToRemove())
end
local g=Group.CreateGroup()
if a:IsRelateToBattle() then g:AddCard(a) end
if t~=nil and t:IsRelateToBattle() then g:AddCard(t) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local g=Group.FromCards(a,d)
local rg=g:Filter(Card.IsRelateToBattle,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.