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:
|
If you control a monster that is not a "Burning Abyss" monster, destroy this card. You can only use 1 of these effects of "Graff, Malebranche of the Burning Abyss" per turn, and only once that turn. ● If you control no Spell/Trap Cards: You can Special Summon this card from your hand. ● If this card is sent to the Graveyard: You can Special Summon 1 "Burning Abyss" monster from your Deck, except "Graff, Malebranche of the Burning Abyss".
|
--彼岸の悪鬼 グラバースニッチ
--Graff, Malebranche of the Burning Abyss
local s,id=GetID()
function s.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(s.sdcon)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.sscon)
e2:SetTarget(s.sstg)
e2:SetOperation(s.ssop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_BURNING_ABYSS}
s.listed_names={id}
function s.sdfilter(c)
return not c:IsFaceup() or not c:IsSetCard(SET_BURNING_ABYSS)
end
function s.sdcon(e)
return Duel.IsExistingMatchingCard(s.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.filter(c)
return c:IsSpellTrap()
end
function s.sscon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.ssop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_BURNING_ABYSS) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Select 1 face-up Spell Card on the field. The controller of the Spell Card takes 500 points of damage during each of your Standby Phases. When the selected card is removed from the field, destroy this card.
|
--魔力無力化の仮面
--Mask of Dispel
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Inflict 500 damage to that Spell's controller
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_PHASE|PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
--When that Spell leaves the field, destroy this card
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(s.descon)
e3:SetOperation(function(e) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end)
c:RegisterEffect(e3)
end
function s.filter(c)
return c:IsFaceup() and c:IsSpell()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.filter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
c:SetCardTarget(tc)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and Duel.IsTurnPlayer(e:GetHandlerPlayer())
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local p=e:GetHandler():GetFirstCardTarget():GetControler()
Duel.SetTargetPlayer(p)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetFirstCardTarget():GetControler()
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You cannot Pendulum Summon monsters, except "Nekroz" and "Zefra" monsters. This effect cannot be negated. ---------------------------------------- [ Monster Effect ] While this card is in your hand or Graveyard, if a face-up "Nekroz" or "Zefra" card(s), except "Zefraxa, Flame Beast of the Nekroz", is destroyed by battle or card effect while in your Monster Zone or Pendulum Zone: You can Special Summon this card. You can only use this effect of "Zefraxa, Flame Beast of the Nekroz" once per turn.
|
--炎獣の影霊衣-セフィラエグザ
--Zefraxa, Flame Beast of the Nekroz
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
Pendulum.AddProcedure(c)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetTargetRange(1,0)
e2:SetTarget(s.splimit)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_HAND|LOCATION_GRAVE)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,id)
e3:SetCondition(s.condition)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
end
s.listed_series={SET_NEKROZ,SET_ZEFRA}
s.listed_names={id}
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
if c:IsSetCard({SET_NEKROZ,SET_ZEFRA}) then return false end
return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function s.filter(c,tp)
return c:IsReason(REASON_BATTLE|REASON_EFFECT)
and c:IsSetCard({SET_NEKROZ,SET_ZEFRA}) and not c:IsCode(id)
and c:IsPreviousControler(tp)
and ((c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP))
or c:IsPreviousLocation(LOCATION_PZONE))
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return 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)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send 1 Rock monster from your Deck to the GY; inflict 500 damage to your opponent.
|
--岩投げアタック
--Rock Bombardment
local s,id=GetID()
function s.initial_effect(c)
--send to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cfilter(c)
return c:IsRace(RACE_ROCK) 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_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.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:
|
3 Level 5 monsters Once per turn, during either player's turn: You can detach 1 Xyz Material from this card, then target 1 face-up monster your opponent controls; inflict damage to your opponent equal to the difference between that monster's original ATK and current ATK, and if you do, banish it. When this card is destroyed and sent to the Graveyard while it has Xyz Material: You can Special Summon this card. "Number 103: Ragnazero" must be in your Graveyard to activate and to resolve this effect.
|
--CNo.103 神葬零嬢ラグナ・インフィニティ
--Number C103: Ragnafinity
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,5,3)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(Cost.DetachFromSelf(1))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--
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_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.xyz_number=103
s.listed_names={94380860}
function s.filter(c)
return c:IsFaceup() and c:GetAttack()~=c:GetBaseAttack() and c:IsAbleToRemove()
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 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_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
local atk=math.abs(tc:GetAttack()-tc:GetBaseAttack())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,1-tp,atk)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local atk=math.abs(tc:GetAttack()-tc:GetBaseAttack())
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Damage(1-tp,atk,REASON_EFFECT)~=0 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,94380860) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,94380860) then return end
if e:GetHandler():IsRelateToEffect(e) 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:
|
You can discard 1 "Salamangreat" monster; send 1 "Salamangreat" monster from your Deck to the GY, then draw 1 card. If you control a "Salamangreat" Link Monster that was Link Summoned using a monster with its same name as material: You can discard 1 "Salamangreat" monster; draw 2 cards. You can only use 1 "Salamangreat Gift" effect per turn, and only once that turn.
|
--サラマングレイト・ギフト
--Salamangreat Gift
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
aux.EnableCheckReincarnation(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw (default)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCost(s.cost)
e2:SetTarget(s.drtg1)
e2:SetOperation(s.drop1)
c:RegisterEffect(e2)
--draw (reinc)
local e3=e2:Clone()
e3:SetCategory(CATEGORY_DRAW)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCountLimit(1,id)
e3:SetCondition(s.drcon)
e3:SetTarget(s.drtg2)
e3:SetOperation(s.drop2)
c:RegisterEffect(e3)
end
s.listed_series={SET_SALAMANGREAT}
function s.cfilter(c)
return c:IsMonster() and c:IsSetCard(SET_SALAMANGREAT) 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,nil)
end
function s.gyfilter(c)
return c:IsMonster() and c:IsSetCard(SET_SALAMANGREAT) and c:IsAbleToGrave()
end
function s.drtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(s.gyfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop1(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.gyfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.lkfilter(c)
return c:IsSetCard(SET_SALAMANGREAT) and c:IsLinkMonster() and c:IsReincarnationSummoned()
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.lkfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.drtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function s.drop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is destroyed by battle and sent to the Graveyard, you can Special Summon 1 "Bicular" from your hand or Deck.
|
--ヴィークラー
--Tricular
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_names={83392426}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function s.filter(c,e,tp)
return c:IsCode(83392426) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_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.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_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:
|
If you control no monsters, or all monsters you control are Psychic and/or Wyrm monsters, you can Normal Summon this card without Tributing. If this card is in your GY: You can discard 1 Psychic or Wyrm monster; Special Summon this card as a Tuner, but banish it when it leaves the field, also for the rest of this turn, you can only Special Summon Level/Rank 3 or higher monsters. You can only use this effect of "Virtual World Oto-Hime - Toutou" once per turn.
|
--電脳堺嫦-兎々
--Virtual World Oto-Hime - Toutou
--Scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--If you control no monsters, or all monsters you control are Psychic and/or Wyrm monsters, you can Normal Summon this card without Tributing
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
c:RegisterEffect(e1)
--Special Summon this card as a Tuner, but banish it when it leaves the field, also for the rest of this turn, you can only Special Summon Level/Rank 3 or higher monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(Cost.Discard(function(c) return c:IsRace(RACE_PSYCHIC|RACE_WYRM) end))
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.ntconfilter(c)
return c:IsFacedown() or not c:IsRace(RACE_PSYCHIC|RACE_WYRM)
end
function s.ntcon(e,c,minc,zone)
if c==nil then return true end
local tp=c:GetControler()
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and not Duel.IsExistingMatchingCard(s.ntconfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER)
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
--Treated as a tuner
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
--Banish it when it leaves the field
local e2=Effect.CreateEffect(c)
e2:SetDescription(3300)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT|RESETS_REDIRECT)
c:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
--For the rest of this turn, you can only Special Summon Level/Rank 3 or higher monsters
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetTarget(function(e,c) return not (c:IsLevelAbove(3) or c:IsRankAbove(3)) end)
e3:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e3,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can target 1 Xyz Monster you control; attach 1 face-up Level 4 LIGHT monster you control to that target as an Xyz Material. When this card is sent from the field to the Graveyard: Target 2 Level 4 LIGHT Thunder-Type monsters with the same name in your Graveyard; add those targets to your hand.
|
--スピリット変換装置
--Spirit Converter
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)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(s.mattg)
e2:SetOperation(s.matop)
c:RegisterEffect(e2)
--salvage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function s.matfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==4 and not c:IsType(TYPE_TOKEN)
end
function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.matfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
Duel.Overlay(tc,g)
end
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.thfilter(c,e)
return c:IsRace(RACE_THUNDER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==4 and c:IsCanBeEffectTarget(e)
end
function s.thfilter2(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode())
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.thfilter(chkc,e) end
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:FilterSelect(tp,s.thfilter2,1,1,nil,g)
if #g1>0 then
local g2=g:FilterSelect(tp,Card.IsCode,1,1,g1:GetFirst(),g1:GetFirst():GetCode())
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you have 5 or more "Spellbook" Spell Cards in your Graveyard: Excavate the top 2 cards of your Deck, add any excavated "Spellbook" Spell Cards to your hand, also shuffle the other cards into the Deck. You can only activate 1 "Spellbook Library of the Heliosphere" per turn. You cannot activate any Spell Cards the turn you activate this card, except "Spellbook" Spell Cards.
|
--魔導書庫ソレイン
--Spellbook Library of the Heliosphere
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:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
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)
aux.GlobalCheck(s,function()
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end)
end
s.listed_series={SET_SPELLBOOK}
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and not re:GetHandler():IsSetCard(SET_SPELLBOOK) then
Duel.RegisterFlagEffect(rp,id+1,RESET_PHASE|PHASE_END,0,1)
end
end
function s.cfilter(c)
return c:IsSpell() and c:IsSetCard(SET_SPELLBOOK)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,5,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id+1)==0 end
--oath effects
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil)
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and not re:GetHandler():IsSetCard(SET_SPELLBOOK)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<2 then return false end
local g=Duel.GetDecktopGroup(tp,2)
return g:FilterCount(Card.IsAbleToHand,nil)>0
end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function s.filter(c)
return c:IsSpell() and c:IsSetCard(SET_SPELLBOOK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.ConfirmDecktop(p,2)
local g=Duel.GetDecktopGroup(p,2)
if #g>0 then
local sg=g:Filter(s.filter,nil)
if #sg>0 then
if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
else
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
Duel.ShuffleDeck(p)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a Fish, Sea Serpent, or Aqua-Type monster is Normal or Special Summoned to your side of the field: You can Special Summon this card from your hand. This card cannot be used as a Synchro Material Monster.
|
--シャーク・サッカー
--Shark Stickers
local s,id=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_FISH|RACE_SEASERPENT|RACE_AQUA)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be targeted by an opponent's card effects. During your Standby Phase: Gain 1000 LP. If this card is destroyed by battle or card effect and sent to the Graveyard: You can banish this card from your Graveyard; Special Summon 1 Level 6 or lower "Kozmo" monster from your Deck.
|
--Kozmo-フォアランナー
--Kozmo Forerunner
local s,id=GetID()
function s.initial_effect(c)
--cannot be targeted
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE|PHASE_STANDBY)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(s.reccon)
e2:SetTarget(s.rectg)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCondition(s.spcon)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_KOZMO}
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function s.spcon(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.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_GRAVE) and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_KOZMO) and c:IsLevelBelow(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card you control is destroyed and sent to your Graveyard: You can Special Summon 1 "Evolsaur" monster from your hand.
|
--エヴォルド・プレウロス
--Evoltile Pleuro
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_series={SET_EVOLSAUR}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousControler(tp)
and e:GetHandler():IsReason(REASON_DESTROY)
end
function s.filter(c,e,tp)
return c:IsSetCard(SET_EVOLSAUR) and c:IsCanBeSpecialSummoned(e,153,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_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 Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,153,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can only activate this card when there are "Don Zaloog", "Dark Scorpion - Cliff the Trap Remover", "Dark Scorpion - Chick the Yellow", "Dark Scorpion - Gorg the Strong", and "Dark Scorpion - Meanae the Thorn" face-up on your side of the field. During this turn, any of these 5 cards can attack your opponent's Life Points directly. In that case, the Battle Damage inflicted to your opponent by each of those cards becomes 400 points.
|
--必殺!黒蠍コンビネーション
--Dark Scorpion Combination
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.con)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
s.listed_names={76922029,6967870,61587183,48768179,74153887}
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,76922029),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,6967870),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,61587183),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,48768179),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,74153887),tp,LOCATION_MZONE,0,1,nil)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
Duel.SetTargetCard(g)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.affected)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCondition(s.rdcon)
e2:SetValue(400)
e2:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.affected(e,c)
return c:GetFlagEffect(id)~=0
end
function s.rdcon(e)
return Duel.GetAttacker():GetFlagEffect(id)~=0 and Duel.GetAttackTarget()==nil
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Banish 2 monsters from your hand and/or face-up field with the same original Type and Attribute, but different names; add 1 monster with the same original Type and Attribute as those monsters, but a different name, from your Deck to your hand. You can only activate 1 "Cross Breed" per turn.
|
--クロス・ブリード
--Cross Breed
--
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.costfilter1(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsMonster() and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(s.costfilter2,tp,LOCATION_HAND|LOCATION_MZONE,0,1,c,c,tp)
end
function s.costfilter2(c,tc,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsMonster() and c:IsAbleToRemoveAsCost()
and c:GetOriginalRace()==tc:GetOriginalRace() and c:GetOriginalAttribute()==tc:GetOriginalAttribute() and c:GetOriginalCode()~=tc:GetOriginalCode()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c,tc)
end
function s.thfilter(c,tc1,tc2)
return c:GetOriginalRace()==tc1:GetOriginalRace() and c:GetOriginalAttribute()==tc1:GetOriginalAttribute()
and c:GetOriginalCode()~=tc1:GetOriginalCode() and c:GetOriginalCode()~=tc2:GetOriginalCode()
and c:IsMonster() and c:IsAbleToHand()
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 e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingMatchingCard(s.costfilter1,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,s.costfilter1,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,s.costfilter2,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst(),tp)
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=tg:GetFirst()
local tc2=tg:GetNext()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc1,tc2)
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:
|
Gain 400 Life Points.
|
--ブルー・ポーション
--Blue Medicine
local s,id=GetID()
function s.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.rectg)
e1:SetOperation(s.recop)
c:RegisterEffect(e1)
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(400)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,400)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 monster in your opponent's GY; Special Summon it to your field, but its effects are negated, then, you can banish 1 monster from both players' fields that have the same Type as each other. You can only activate 1 "Ice Dragon's Prison" per turn.
|
--天龍雪獄
--Ice Dragon's Prison
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.rmfilter(c,tp)
return c:IsFaceup() and c:IsAbleToRemove()
end
function s.rescon(sg,e,tp,mg)
return sg:GetClassCount(Card.GetRace)==1 and sg:GetClassCount(Card.GetControler)==#sg
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
--Negate effect(s)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
local rg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_REMOVE)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can discard this card; add 1 "Ryu-Ge Realm - Sea Spires" from your Deck to your hand. During your Main Phase, if 2 or more monsters were sent from the hand and/or Deck to the GY this turn, except "Kairo Ryu-Ge Emva": You can Special Summon this card from your GY. You can place 1 "Ryu-Ge Realm - Sea Spires" you control on the bottom of the Deck; banish your opponent's entire hand, and if you do, they draw the same number of cards. You can only use each effect of "Kairo Ryu-Ge Emva" once per turn.
|
--海瀧竜華-淵巴
--Kairo Ryu-Ge Emva
--Scripted by Satellaa
local s,id=GetID()
function s.initial_effect(c)
--Add 1 "Ryu-Ge Realm - Sea Spires" 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_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Special Summon this card from your GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function() return Duel.HasFlagEffect(0,id,2) end)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Keep track of how many monsters have been sent from the hand or Deck to the GY in a given turn
aux.GlobalCheck(s,function()
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end)
--Banish your opponent's entire hand, and if you do, they draw the same number of cards
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,{id,2})
e3:SetCost(s.rmcost)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
end
s.listed_names={28669235,id} --"Ryu-Ge Realm - Sea Spires"
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in eg:Iter() do
if tc:IsMonster() and tc:IsPreviousLocation(LOCATION_HAND|LOCATION_DECK) and not tc:IsCode(id) then
Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_END,0,1)
end
end
end
function s.thfilter(c)
return c:IsCode(28669235) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.tdfilter(c)
return c:IsCode(28669235) and c:IsFaceup() and c:IsAbleToDeckAsCost()
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,ct)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
if #g==0 then return end
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if ct>0 then
Duel.Draw(1-tp,ct,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
While you control 2 or more face-up Defense Position monsters, your opponent cannot target Defense Position monsters you control with card effects, and they cannot be destroyed by your opponent's card effects. If this card would be destroyed by card effect, you can destroy 1 card in your Spell & Trap Zone instead.
|
--スクラム・フォース
--Scrum Force
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)
--Prevent destruction by opponent's effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(s.con)
e2:SetTarget(s.tg)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--Prevent effect target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(s.con)
e3:SetTarget(s.tg)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--Destruction replacement
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(s.desreptg)
e4:SetOperation(s.desrepop)
c:RegisterEffect(e4)
end
function s.con(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsPosition,POS_FACEUP_DEFENSE),e:GetHandlerPlayer(),LOCATION_MZONE,0,2,nil)
end
function s.tg(e,c)
return c:IsDefensePos()
end
function s.repfilter(c,e)
return c:GetSequence()<5 and c:IsDestructable(e)
and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function s.desreptg(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:IsOnField() and c:IsFaceup()
and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_SZONE,0,1,c,e) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_SZONE,0,1,1,c,e)
e:SetLabelObject(g:GetFirst())
Duel.HintSelection(g)
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT|REASON_REPLACE)
end
|
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 monster from your hand to the GY. For a Synchro Summon, you can substitute this card for any 1 "Synchron" Tuner. Cannot be used as a Synchro Material, except for the Synchro Summon of a monster that mentions a "Synchron" Tuner as material.
|
--クイック・シンクロン
--Quickdraw Synchron
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:SetOperation(s.spop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(s.synlimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(id)
c:RegisterEffect(e3)
end
function s.synlimit(e,c)
if not c then return false end
return not c:ListsArchetypeAsMaterial(SET_SYNCHRON)
end
function s.spfilter(c)
return c:IsMonster() and c:IsAbleToGraveAsCost()
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.spfilter,tp,LOCATION_HAND,0,1,c)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Main Phase: Reveal 1 "Azamina" Fusion Monster in your Extra Deck, and for every 4 Levels it has (round down), send 1 "Sinful Spoils" card from your hand and/or field to the GY (if face-down, reveal it), then Special Summon that revealed monster. (This is treated as a Fusion Summon.) During your Main Phase: You can banish this card from your GY, then target 1 "Azamina" monster in your GY; Special Summon it. You can only use 1 "Azamina Debtors" effect per turn, and only once that turn.
|
--アザミナ・オフェイレーテス
--Azamina Debtors
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Send "Sinful Spoils" cards to the GY and Special Summon 1 "Azamina" Fusion Monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,id)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Special Summon 1 "Azamina" monster from your GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.gysptg)
e2:SetOperation(s.gyspop)
c:RegisterEffect(e2)
end
s.listed_series={SET_AZAMINA,SET_SINFUL_SPOILS}
function s.sinfilter(c)
return c:IsSetCard(SET_SINFUL_SPOILS) and c:IsAbleToGrave()
end
function s.exspfilter(c,e,tp,lv)
return c:IsSetCard(SET_AZAMINA) and c:IsType(TYPE_FUSION) and c:IsLevelAbove(4) and c:IsLevelBelow(lv) and not c:IsPublic()
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroupCount(s.sinfilter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,nil)
return ct>0 and Duel.IsExistingMatchingCard(s.exspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,ct*4+3)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_ONFIELD|LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.sinfilter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,nil)
if #sg<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.exspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,#sg*4+3):GetFirst()
if not tc then return end
Duel.ConfirmCards(1-tp,tc)
local ct=tc:GetLevel()//4
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local ssg=sg:Select(tp,ct,ct,nil)
if #ssg==0 then return end
local fdg=ssg:Filter(aux.AND(Card.IsFacedown,Card.IsOnField),nil)
if #fdg>0 then
Duel.ConfirmCards(1-tp,fdg)
end
if Duel.SendtoGrave(ssg,REASON_EFFECT)>0 and ssg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
tc:SetMaterial(nil)
Duel.BreakEffect()
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)==0 then return end
tc:CompleteProcedure()
end
end
function s.gyspfilter(c,e,tp)
return c:IsSetCard(SET_AZAMINA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.gysptg(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.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
end
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2+ WATER monsters While this card is in the Extra Monster Zone, your opponent's monsters cannot attack any monsters, except this one. You can only use each of the following effects of "Marincess Aqua Argonaut" once per turn. You can target 1 WATER monster you control and 1 card your opponent controls; return them to the hand. During your opponent's turn, when a Spell/Trap Card or effect is activated on the field (Quick Effect): You can Special Summon 1 of your "Marincess" Monster Cards equipped to this card, and if you do, negate that activated effect.
|
--海晶乙女アクア・アルゴノート
--Marincess Aqua Argonaut
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--2+ WATER monsters
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_WATER),2)
--Attack target limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_EMZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(function(e,c)return c~=e:GetHandler()end)
c:RegisterEffect(e1)
--Return to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--Special Summon and negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_MARINCESS}
function s.thfilter(c,e,tp)
return ((c:IsMonster() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup() and c:IsControler(tp))
or c:IsControler(1-tp)) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function s.rescon(sg,e,tp,mg)
return sg:FilterCount(Card.IsControler,nil,tp)==1
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local rg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e,tp)
if chk==0 then return aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,0) end
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,1,tp,HINTMSG_RTOHAND)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and re:IsSpellTrapEffect() and Duel.IsChainDisablable(ev)
and (Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)&LOCATION_ONFIELD)~=0
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_MARINCESS) and c:IsOriginalType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:GetEquipGroup():IsExists(s.spfilter,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=c:GetEquipGroup():FilterSelect(tp,s.spfilter,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.NegateEffect(ev)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control a "Numerounius" monster: Destroy as many Spells/Traps your opponent controls as possible (min. 1), and if you do, inflict 1000 damage to your opponent.
|
--ヌメロン・ストーム
--Numeron Storm
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_NUMEROUNIOUS}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_NUMEROUNIOUS),tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(sg,REASON_EFFECT)>0 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Your opponent cannot target "Maliss" Link Monsters that point to this card with card effects. You can only use each of the following effects of "Maliss <P> March Hare" once per turn. During the Main Phase, if this card is in your hand (Quick Effect): You can banish 1 other "Maliss" card from your hand or GY, and if you do, Special Summon this card. If this card is banished: You can pay 300 LP, then target 1 of your banished "Maliss" monsters; add it to your hand.
|
--M∀LICE<P>March Hare
--Maliss <P> March Hare
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Your opponent cannot target "Maliss" Link Monsters that point to this card with card effects
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(s.linkfilter)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--Banish 1 other "Maliss" card from your hand or GY, and if you do, Special Summon this card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,id)
e2:SetCondition(function() return Duel.IsMainPhase() end)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Add 1 of your banished "Maliss" monsters to your hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,{id,1})
e3:SetCost(Cost.PayLP(300))
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_series={SET_MALISS}
function s.linkfilter(e,c)
return c:IsSetCard(SET_MALISS) and c:IsType(TYPE_LINK) and c:GetLinkedGroup():IsContains(e:GetHandler())
end
function s.rmfilter(c,tp)
return c:IsSetCard(SET_MALISS) and c:IsAbleToRemove() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true))
and Duel.GetMZoneCount(tp,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,c,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local exc=c:IsRelateToEffect(e) and c or nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,1,exc,tp)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thfilter(c)
return c:IsSetCard(SET_MALISS) and c:IsMonster() and c:IsFaceup() 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,tp,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If all monsters your opponent controls are in Defense Position, this card can attack your opponent directly.
|
--闇の住人シャドウキラー
--Shadowslayer
local s,id=GetID()
function s.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(s.con)
c:RegisterEffect(e1)
end
function s.con(e)
return not Duel.IsExistingMatchingCard(Card.IsAttackPos,e:GetHandler():GetControler(),0,LOCATION_MZONE,1,nil)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
After 1 of your Counter Trap Cards has been activated and has resolved, you can Tribute all monsters you control to Special Summon this card. If this card is Special Summoned in this way, you can destroy cards your opponent controls up to the number of Fairy-Type monsters you Tributed.
|
--裁きを下す者-ボルテニス
--Voltanis the Adjudicator
local s,id=GetID()
function s.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetOperation(s.chop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_HAND)
e2:SetOperation(s.chop2)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAIN_END)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(s.sumcon)
e3:SetCost(s.sumcost)
e3:SetTarget(s.sumtg)
e3:SetOperation(s.sumop)
c:RegisterEffect(e3)
e1:SetLabelObject(e3)
e2:SetLabelObject(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
e3:SetLabelObject(e4)
end
function s.chop1(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(0)
end
function s.chop2(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_COUNTER) then return end
e:GetLabelObject():SetLabel(1)
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()==1
end
function s.cfilter(c,tp)
return c:GetSequence()<5 and c:IsControler(tp)
end
function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g,exg=Duel.GetReleaseGroup(tp):Split(aux.ReleaseCostFilter,nil,tp)
if chk==0 then return #g>0 and g:FilterCount(s.cfilter,nil,tp)+Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
if #(exg-g)>0 and Duel.SelectYesNo(tp,aux.Stringid(59160188,2)) then
g=g+(exg-g)
end
local ct=g:FilterCount(Card.IsRace,nil,RACE_FAIRY)
Duel.Release(g,REASON_COST)
e:GetLabelObject():SetLabel(ct)
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) and e:GetLabel()>0 end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,e:GetLabel(),nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When an opponent's monster declares a direct attack, if its ATK is greater than or equal to your LP: Special Summon this card in Attack Position as an Effect Monster (Warrior-Type/LIGHT/Level 4/ATK ?/DEF 0) that has ATK equal to your LP, then change the attack target to this card. (This card is also still a Trap Card.) If this card Summoned this way is destroyed by battle, after damage calculation: Inflict damage to your opponent equal to its ATK.
|
--クリスタル・アバター
--Krystal Avatar
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_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.GetAttacker():IsAttackAbove(Duel.GetLP(tp))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=Duel.GetLP(tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,atk,0,4,RACE_WARRIOR,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local atk=Duel.GetLP(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,atk,0,4,RACE_WARRIOR,ATTRIBUTE_LIGHT) then return end
c:AddMonsterAttribute(TYPE_TRAP|TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLED)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
local at=Duel.GetAttacker()
if at and at:CanAttack() and at:IsFaceup() and not at:IsImmuneToEffect(e) and not at:IsStatus(STATUS_ATTACK_CANCELED) then
Duel.BreakEffect()
Duel.ChangeAttackTarget(c)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetHandler():GetAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,e:GetHandler():GetAttack(),REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Destroy 1 face-up monster with an A-Counter(s), and then inflict 1000 damage to each player.
|
--デストラクト・サークル-A
--Detonator Circle "A"
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.counter_list={COUNTER_A}
function s.filter(c)
return c:GetCounter(COUNTER_A)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,1000)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:GetCounter(COUNTER_A)>0 and tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,1000,REASON_EFFECT,true)
Duel.Damage(tp,1000,REASON_EFFECT,true)
Duel.RDComplete()
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 monster your opponent controls equipped with your "Attraction" Trap(s); equip this card to it. While this card is equipped to a monster, take control of the equipped monster. While you control the equipped monster, it gains 500 ATK, you cannot activate its effects, also it is treated as an "Amazement" monster. You can only activate 1 "Amazement Family Faces" per turn.
|
--アメイズメント・ファミリーフェイス
--Amazement Family Faces
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Equip this card to 1 monster
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_CONTROL+CATEGORY_EQUIP)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e0:SetCost(aux.RemainFieldCost)
e0:SetTarget(s.target)
e0:SetOperation(s.activate)
c:RegisterEffect(e0)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(s.condition)
e1:SetValue(500)
c:RegisterEffect(e1)
--cannot trigger
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetCondition(s.condition)
c:RegisterEffect(e2)
--change archetype
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_ADD_SETCODE)
e3:SetValue(SET_AMAZEMENT)
e3:SetCondition(s.condition)
c:RegisterEffect(e3)
--control
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_SET_CONTROL)
e4:SetValue(function(e)return e:GetHandlerPlayer()end)
c:RegisterEffect(e4)
end
s.listed_series={SET_AMAZEMENT,SET_ATTRACTION}
function s.eqcfilter(c,tp)
return c:IsSetCard(SET_ATTRACTION) and c:IsTrap() and c:IsControler(tp)
end
function s.eqfilter(c,e,tp)
return aux.CheckStealEquip(c,e,tp) and c:GetEquipGroup():IsExists(s.eqcfilter,1,nil,tp)
end
function s.eqlimit(e,c)
return e:GetHandlerPlayer()~=c:GetControler() or e:GetHandler():GetEquipTarget()==c
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc,e,tp) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) or not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
else
c:CancelToGrave(false)
end
end
function s.condition(e)
return e:GetHandler():GetControler()==e:GetHandlerPlayer()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If your opponent controls a monster(s) Special Summoned from the Extra Deck and you do not: Choose 4 "Number" Xyz Monsters from your Extra Deck with different Ranks, plus a 5th "Number" Xyz Monster whose "Number" value in its name equals the combined "Number" values of the 4 other monsters, Special Summon that 5th "Number" monster (this is treated as an Xyz Summon), and attach the 4 chosen monsters to it as material, but you cannot Special Summon monsters, except "Number" Xyz Monsters, while you control that face-up monster.
|
--ナンバーズ・エヴァイユ
--Numbers Eveil
--Scripted by Larry126
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:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_NUMBER}
function s.cfilter(c)
return c:IsSpecialSummoned() and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil)==0
end
function s.xyzfilter(c)
return c:IsSetCard(SET_NUMBER) and c:IsType(TYPE_XYZ) and c.xyz_number
end
function s.spfilter(c,e,p,g)
return Duel.GetLocationCountFromEx(p,p,g,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,p,false,false)
and g:GetSum(function(mc)return mc.xyz_number end)==c.xyz_number
end
function s.rescon(sg,e,tp,mg)
return sg:GetClassCount(Card.GetRank)==#sg and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,sg,e,tp,sg)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if chk==0 then return #xg>4 and aux.SelectUnselectGroup(xg,e,tp,4,4,s.rescon,0) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local xg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if #xg<5 then return end
local mg=aux.SelectUnselectGroup(xg,e,tp,4,4,s.rescon,1,tp,HINTMSG_XMATERIAL)
if #mg~=4 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,mg,e,tp,mg):GetFirst()
if spc and Duel.SpecialSummonStep(spc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) then
--Cannot Special Summon, except "Number" Xyz Monsters
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetCondition(function(e) return e:GetHandler():GetControler()==e:GetLabel() end)
e1:SetTarget(function(_,c) return not (c:IsSetCard(SET_NUMBER) and c:IsType(TYPE_XYZ)) end)
e1:SetLabel(tp)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
spc:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
spc:CompleteProcedure()
if not spc:IsImmuneToEffect(e) then Duel.Overlay(spc,mg) end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 2 "Six Samurai" monsters in your GY; Special Summon those targets in Attack Position. During the End Phase of this turn, destroy them, and if you do, take damage equal to those destroyed monsters' ATK.
|
--諸刃の活人剣術
--Double-Edged Sword Technique
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_SIX_SAMURAI}
function s.filter(c,e,tp)
return c:IsSetCard(SET_SIX_SAMURAI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if #sg==0 or ft<=0 or (#sg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then return end
if ft<#sg then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:FilterSelect(tp,s.filter,ft,ft,nil,e,tp)
end
if #sg>0 then
local tc=sg:GetFirst()
local fid=e:GetHandler():GetFieldID()
for tc in aux.Next(sg) do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) then
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid)
end
end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
Duel.RegisterEffect(e1,tp)
end
end
function s.desfilter(c,fid)
return c:GetFlagEffectLabel(id)==fid
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(s.desfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=e:GetLabelObject()
local dg=sg:Filter(s.desfilter,nil,e:GetLabel())
sg:DeleteGroup()
if #dg>0 then
local tg1=dg:GetFirst()
local at1=tg1:GetAttack()
local tg2=dg:GetNext()
local at2=0
local dam=0
if tg2 then at2=tg2:GetAttack() end
Duel.Destroy(dg,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsContains(tg1) then dam=dam+at1 end
if tg2 and og:IsContains(tg2) then dam=dam+at2 end
if dam~=0 then Duel.Damage(tp,dam,REASON_EFFECT) end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Main Phase, you can: Fusion Summon 1 "Shaddoll" Fusion Monster from your Extra Deck, by banishing Fusion Materials mentioned on it from your field or GY, but it cannot attack directly. Then, you can send to the GY 1 monster your opponent controls with the same Attribute as that Fusion Summoned monster. You can only use this effect of "Shaddoll Schism" once per turn.
|
--影依の偽典
--Shaddoll Schism
--scripted by Naim and edo9300
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)
--Fusion Summon 1 "Shaddoll" Fusion Monster from your Extra Deck, by banishing Fusion Materials mentioned on it from your field or GY, but it cannot attack directly
local e1=Fusion.CreateSummonEff({handler=c,fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_SHADDOLL),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),
extrafil=s.fextra,extraop=Fusion.BanishMaterial,stage2=s.stage2,desc=aux.Stringid(id,0),extratg=s.extratg})
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,id)
e1:SetCondition(function() return Duel.IsMainPhase() end)
c:RegisterEffect(e1)
end
s.listed_series={SET_SHADDOLL}
function s.fextra(e,tp,mg)
if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil)
end
end
function s.tgfilter(c,attr)
return c:IsAttribute(attr) and c:IsFaceup() and c:IsAbleToGrave()
end
function s.stage2(e,tc,tp,sg,chk)
if chk==1 then
--It cannot attack directly
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3207)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
local attr=tc:GetAttribute()
if Duel.IsExistingMatchingCard(s.tgfilter,tp,0,LOCATION_MZONE,1,nil,attr)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,attr)
if #g>0 then
Duel.HintSelection(g)
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE|LOCATION_GRAVE)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_MZONE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card can make a second attack during each Battle Phase.
|
--隼の騎士
--Hayabusa Knight
local s,id=GetID()
function s.initial_effect(c)
--double attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is Normal or Special Summoned: You can discard 1 card; add 1 Insect or Plant Tuner from your Deck to your hand, except "Cyclos the Circular Sprite". If an Insect or Plant Synchro Monster(s) is Special Summoned, while this card is in your GY (except during the Damage Step): You can Special Summon this card, but banish it when it leaves the field. You can only use each effect of "Cyclos the Circular Sprite" once per turn.
|
--円喚妖精キクロス
--Cyclos the Circular Sprite
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Search 1 Insect or Plant Tuner monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Special Summon this card from the GY
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_names={id}
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD,nil)
end
function s.thfilter(c)
return c:IsRace(RACE_PLANT|RACE_INSECT) and c:IsType(TYPE_TUNER) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.cfilter(c)
return c:IsRace(RACE_PLANT|RACE_INSECT) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
--Banish itself 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:
|
2 Level 4 monsters While this card has a material attached that was originally WATER, all WATER monsters you control gain 500 ATK. Once per turn (Quick Effect): You can detach 1 material from this card; your opponent cannot activate any card effects in their GY this turn.
|
--深淵に潜む者
--Abyss Dweller
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,4,2)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(s.atkcon)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER))
e1:SetValue(500)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_DRAW_PHASE)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(Cost.DetachFromSelf(1))
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.atkcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Gains 700 ATK/DEF for each "Argostars" monster with a different name you control, except this card. You can only use each of the following effects of "Argostars - Fierce Parthe" once per turn. (Quick Effect): You can reveal this card in your hand; return 1 "Argostars" Continuous Trap you control to the hand, and if you do, Special Summon this card. You can banish this card you control; Set 1 Continuous Trap from your hand. It can be activated this turn.
|
--ARG☆S-熱闘のパルテ
--Argostars - Fierce Parthe
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Gains 700 ATK/DEF for each other "Argostars" monster you control with different names
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(s.atkdefval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--Return 1 face-up "Argostars" Continuous Trap you control to the hand, and if you do, Special Summon this card
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e3:SetCountLimit(1,id)
e3:SetCost(Cost.SelfReveal)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
--Set 1 Continuous Trap from your hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,{id,1})
e4:SetCost(Cost.SelfBanish)
e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4)
end
s.listed_series={SET_ARGOSTARS}
function s.atkdefval(e,c)
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_ARGOSTARS),e:GetHandlerPlayer(),LOCATION_MZONE,0,e:GetHandler())
return g:GetClassCount(Card.GetCode)*700
end
function s.thfilter(c,tp)
return c:IsSetCard(SET_ARGOSTARS) and c:IsContinuousTrap() and c:IsFaceup() and c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)>0
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.setfilter(c)
return c:IsContinuousTrap() 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_HAND,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if sc and Duel.SSet(tp,sc)>0 then
--It can be activated this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESETS_STANDARD_PHASE_END)
sc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Each time a Spell Card is activated, place 1 Spell Counter on this card when that Spell Card resolves. You can remove any number of Spell Counters from this card, then target 1 face-up monster on the field with ATK less than or equal to the number of counters you removed x 700; destroy that target.
|
--ブラッド・マジシャン-煉獄の魔術師-
--Blast Magician
local s,id=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(COUNTER_SPELL)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.counter_list={COUNTER_SPELL}
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsSpellEffect() and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(COUNTER_SPELL,1)
end
end
function s.filter(c,cc,tp)
local ct=math.ceil(c:GetAttack()/700)
if ct==0 then ct=1 end
return c:IsFaceup() and cc:IsCanRemoveCounter(tp,COUNTER_SPELL,ct,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,e:GetHandler(),tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e:GetHandler(),tp)
local ct=math.ceil(g:GetFirst():GetAttack()/700)
if ct==0 then ct=1 end
e:GetHandler():RemoveCounter(tp,COUNTER_SPELL,ct,REASON_COST)
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:
|
During your Main Phase: You can send 1 "Pinecono" from your hand to the Graveyard, and Special Summon this card from the hand.
|
--コロボックリ
--Acorno
local s,id=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
s.listed_names={67445676}
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(Card.IsCode,tp,LOCATION_HAND,0,1,nil,67445676)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_HAND,0,1,1,nil,67445676)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Special Summon 1 Insect monster with 1000 or less ATK from your hand or Deck, then if you Special Summoned from the Deck, send 1 monster you control to the GY, also you cannot Special Summon for the rest of this turn after this card resolves, except Insect monsters. If a face-up Insect Synchro Monster(s) you control is destroyed by battle or card effect, while this card is in your GY: You can banish this card; add 1 "Summoning Swarm" from your Deck to your hand. You can only activate 1 "Armed Rebeellion" per turn.
|
--武装蜂起
--Armed Rebeellion
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
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)
--Add 1 "Summoning Swarm" from your 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_DAMAGE_STEP+EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.thcon)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_names={52838896} --"Summoning Swarm"
function s.spfilter(c,e,tp)
return c:IsRace(RACE_INSECT) and c:IsAttackBelow(1000) 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_HAND|LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
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:IsSummonLocation(LOCATION_DECK) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
--Cannot Special Summon for the rest of this turn after this card resolves, except Insect monsters
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c) return not c:IsRace(RACE_INSECT) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.thconfilter(c,tp)
return c:IsPreviousRaceOnField(RACE_INSECT) and c:IsPreviousTypeOnField(TYPE_SYNCHRO) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.thconfilter,1,nil,tp)
end
function s.thfilter(c,rc)
return c:IsCode(52838896) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can banish 1 "Marincess" monster from your GY; Special Summon this card from your hand. If this card is sent to the GY as material for the Link Summon of a WATER monster: You can send cards from the top of your Deck to the GY, equal to the number of "Marincess" monsters you control, then, if a "Marincess" card(s) was sent to the GY by this effect, inflict 200 damage to your opponent for each "Marincess" card sent. You can only use each effect of "Marincess Springirl" once per turn.
|
--海晶乙女スプリンガール
--Marincess Springirl
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Special Summon itself from the hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Send cards from the top of your Deck to the GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES+CATEGORY_DAMAGE)
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(s.mlcon)
e2:SetTarget(s.mltg)
e2:SetOperation(s.mlop)
c:RegisterEffect(e2)
end
s.listed_series={SET_MARINCESS}
function s.spcostfilter(c)
return c:IsSetCard(SET_MARINCESS) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil)
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 Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.mlcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsAttribute(ATTRIBUTE_WATER)
end
function s.mltg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_MARINCESS),tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,200)
end
function s.mlop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_MARINCESS),tp,LOCATION_MZONE,0,nil)
if ct<1 or Duel.DiscardDeck(tp,ct,REASON_EFFECT)<1 then return end
local dc=Duel.GetOperatedGroup():Match(Card.IsSetCard,nil,SET_MARINCESS):Match(Card.IsLocation,nil,LOCATION_GRAVE):GetCount()
if dc>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,dc*200,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2+ Level 4 monsters This Xyz Summoned card gains 500 ATK x the total Link Rating of Link Monsters linked to this card. You can detach 2 materials from this card, then target 1 Link-4 Cyberse Link Monster in your GY; Special Summon it to your field so it points to this card, also you cannot Special Summon other monsters or attack directly for the rest of this turn.
|
--ファイアウォール・X・ドラゴン
--Firewall eXceed Dragon
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Xyz.AddProcedure(c,nil,4,2,nil,nil,Xyz.InfiniteMats)
--atk gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.atkcon)
e1:SetValue(s.atkval)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(Cost.DetachFromSelf(2))
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsXyzSummoned()
end
function s.atkfilter(c,xc)
return c:IsFaceup() and c:IsLinkMonster() and c:GetLinkedGroup():IsContains(xc)
end
function s.atkval(e,c)
local g=Duel.GetMatchingGroup(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil,c)
return g:GetSum(Card.GetLink)*500
end
function s.spfilter(c,e,tp,ec)
local zone=ec:GetToBeLinkedZone(c,tp)
return zone~=0 and c:IsLinkMonster() and c:IsRace(RACE_CYBERSE) and c:GetLink()==4
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
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,e:GetHandler()) 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,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local zone=c:GetToBeLinkedZone(tc,tp)
if zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e2,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Select 1 monster on your side of the field and send it to the Graveyard. Increase your Life Points by an amount equal to the original ATK of the monster.
|
--生贄の祭壇
--Altar for Tribute
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,1,nil);
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.SendtoGrave(g,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=e:GetLabel()~=0
e:SetLabel(0)
return res
end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,e:GetLabel())
e:SetLabel(0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent activates a Spell Card (Quick Effect): You can send this card and 1 other Fairy monster from your hand to the GY; negate the activation, and if you do, destroy it.
|
--緑光の宣告者
--Herald of Green Light
local s,id=GetID()
function s.initial_effect(c)
--Negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.discon)
e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsChainNegatable(ev)
end
function s.costfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost()
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and
Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,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)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
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:
|
Banish your opponent's entire hand, and if you do, they draw the same number of cards. You can banish this card from your GY, then target 1 "Trickstar" monster in your GY; Special Summon it.
|
--トリックスター・リンカーネイション
--Trickstar Reincarnation
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetHintTiming(TIMING_STANDBY_PHASE|TIMING_END_PHASE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_series={SET_TRICKSTAR}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local gc=#g
if chk==0 then return gc>0 and g:FilterCount(Card.IsAbleToRemove,nil)==gc and Duel.IsPlayerCanDraw(1-tp,gc) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,gc,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,gc)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local gc=#g
if gc>0 and g:FilterCount(Card.IsAbleToRemove,nil)==gc then
local oc=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if oc>0 then
Duel.Draw(1-tp,oc,REASON_EFFECT)
end
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_TRICKSTAR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) 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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card can be used to Ritual Summon any "Chaos" or "Black Luster Soldier" Ritual Monster. You must also Tribute monsters from your hand or field and/or banish "Blue-Eyes White Dragon" or "Dark Magician" from your GY, whose total Levels exactly equal the Level of the "Chaos" or "Black Luster Soldier" Ritual Monster you Ritual Summon.
|
--カオス・フォーム
--Chaos Form
local s,id=GetID()
function s.initial_effect(c)
--Activate
Ritual.AddProcEqual{handler=c,filter=s.ritualfil,extrafil=s.extrafil,extratg=s.extratg}
end
s.listed_series={SET_CHAOS,SET_NUMBER_C}
s.listed_names={CARD_DARK_MAGICIAN,CARD_BLUEEYES_W_DRAGON}
function s.ritualfil(c)
return c:IsSetCard({SET_CHAOS,SET_NUMBER_C}) and c:IsRitualMonster()
end
function s.mfilter(c)
return not Duel.IsPlayerAffectedByEffect(c:GetControler(),CARD_SPIRIT_ELIMINATION) and c:HasLevel() and c:IsCode(CARD_DARK_MAGICIAN,CARD_BLUEEYES_W_DRAGON)
and c:IsMonster() and c:IsAbleToRemove()
end
function s.extrafil(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_GRAVE,0,nil)
end
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is Normal Summoned: Look at 1 random card in your opponent's Extra Deck, and if it has 2000 or more ATK, this card gains 1000 ATK. If it has less than 2000 ATK, you gain LP equal to that monster's ATK.
|
--華麗なる密偵-C
--Spy-C-Spy
local s,id=GetID()
function s.initial_effect(c)
--LP
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0)
if #g==0 then return end
local tc=g:RandomSelect(tp,1):GetFirst()
Duel.ConfirmCards(tp,tc)
local atk=tc:GetAttack()
if atk<0 then atk=0 end
if atk>=2000 then
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
else
Duel.Recover(tp,atk,REASON_EFFECT)
end
Duel.ShuffleExtra(1-tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Ritual Summon this card with any "Nekroz" Ritual Spell. Must be Ritual Summoned from your hand, using 3 monsters you control with different Types. During the Main Phase 1 (Quick Effect): You can discard this card and 1 "Nekroz" Spell; your opponent cannot Special Summon from the Extra Deck during this phase. When this card is Ritual Summoned: You can banish all other cards on the field and in the GYs. You cannot Normal Summon/Set or Special Summon other monsters the turn you activate this effect. * The above text is unofficial and describes the card's functionality in the OCG.
|
--sophiaの影霊衣
--Nekroz of Sophia
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Must be Ritual Summoned
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--Prevent Special summons from the Extra Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(s.discon)
e2:SetCost(s.discost)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(s.rmcon)
e3:SetCost(s.rmcost)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
end
s.listed_series={SET_NEKROZ}
function s.splimit(e,se,sp,st)
return e:GetHandler():IsLocation(LOCATION_HAND) and (st&SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function s.mat_filter(c)
return c:IsLocation(LOCATION_ONFIELD)
end
function s.onfieldcontroller(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.ritual_custom_check(e,tp,g,c)
local count=#g
local class_count=g:GetClassCount(Card.GetRace)
local onfield_self_count=g:FilterCount(s.onfieldcontroller,nil,tp)
return count==3 and class_count==3 and onfield_self_count==3,count>3 or class_count~=count or onfield_self_count~=count
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPhase(PHASE_MAIN1)
end
function s.cfilter(c)
return c:IsSetCard(SET_NEKROZ) and c:IsSpell() and c:IsDiscardable()
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_DISCARD|REASON_COST)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_PHASE|PHASE_MAIN1)
e1:SetTargetRange(0,1)
e1:SetTarget(s.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsRitualSummoned()
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==1 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
--lizard check
aux.addTempLizardCheck(e:GetHandler(),tp,aux.TRUE,RESET_PHASE|PHASE_END,0,0xff)
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)
aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil)
end
function s.rmfilter(c)
return c:IsAbleToRemove() and (c:IsLocation(LOCATION_SZONE) or aux.SpElimFilter(c,false,true))
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Spellcaster-Type Synchro Monster + 1 Spellcaster-Type monster This monster can only be Special Summoned by Fusion Summon (from the Extra Deck). When this card is Fusion Summoned, place 2 Spell Counters on it. This card gains 1000 ATK for each Spell Counter on it. Once per turn, you can remove 1 Spell Counter from your side of the field to activate 1 of the following effects: ● Select 1 card on the field, and destroy it. ● Draw 1 card.
|
--覇魔導士アーカナイト・マジシャン
--Supreme Arcanite Magician
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
c:EnableCounterPermit(COUNTER_SPELL)
--Fusion Materials: 1 Spellcaster Synchro Monster + 1 Spellcaster monster
Fusion.AddProcMix(c,true,true,s.matfilter,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER))
c:AddMustFirstBeFusionSummoned()
--Place 2 Spell Counters on it
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_SPSUMMON_SUCCESS)
e1:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,e:GetHandler(),2,tp,COUNTER_SPELL) end)
e1:SetOperation(s.counterop)
c:RegisterEffect(e1)
--Gains 1000 ATK for each Spell Counter on it
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(function(e,c) return c:GetCounter(COUNTER_SPELL)*1000 end)
c:RegisterEffect(e2)
--Activate 1 of these effects
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(Cost.RemoveCounterFromField(COUNTER_SPELL,1))
e3:SetTarget(s.efftg)
e3:SetOperation(s.effop)
c:RegisterEffect(e3)
end
s.counter_place_list={COUNTER_SPELL}
s.miracle_synchro_fusion=true
function s.matfilter(c,fc,sumtype,tp)
return c:IsType(TYPE_SYNCHRO,fc,sumtype,tp) and c:IsRace(RACE_SPELLCASTER,fc,sumtype,tp)
end
function s.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(COUNTER_SPELL,2)
end
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetLabel()==1 and chkc:IsOnField() end
local b1=Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)})
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,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
elseif op==2 then
e:SetCategory(CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
--Destroy 1 card on the field
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
elseif op==2 then
--Draw 1 card
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner Synchro Monster + 2+ non-Tuner Synchro Monsters Must be Synchro Summoned. (Quick Effect): You can banish this card until the End Phase to activate 1 of these effects; ● When your opponent activates a card or effect: Negate the activation, and if you do, destroy that card. ● When your opponent would Summon a monster(s): Negate the Summon, and if you do, destroy that monster(s). ● When an opponent's monster declares an attack: Negate the attack, then end the Battle Phase.
|
--コズミック・ブレイザー・ドラゴン
--Cosmic Blazar Dragon
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_SYNCHRO),1,1,Synchro.NonTunerEx(Card.IsType,TYPE_SYNCHRO),2,99)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.synlimit)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.discon)
e2:SetCost(s.cost)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
--disable spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_SUMMON)
e3:SetCondition(s.dscon)
e3:SetCost(s.cost)
e3:SetTarget(s.dstg)
e3:SetOperation(s.dsop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e5)
--negate attack
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,2))
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_ATTACK_ANNOUNCE)
e6:SetCountLimit(1)
e6:SetCondition(s.negcon)
e6:SetCost(s.cost)
e6:SetOperation(s.negop)
c:RegisterEffect(e6)
end
s.synchro_tuner_required=1
s.synchro_nt_required=2
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
end
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.dscon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function s.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,#eg,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,#eg,0,0)
end
function s.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE,1)
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Red-Eyes Black Dragon" + 1 Warrior monster When a "Red-Eyes" monster declares an attack: You can target 1 Warrior monster in your GY; equip it to this card as an Equip Spell that gives this card 200 ATK. When a card or effect is activated that targets a card you control (Quick Effect): You can send 1 Equip Card you control to the GY; negate the activation, and if you do, destroy that card. If this card is destroyed by battle or card effect: You can Special Summon as many monsters from your GY as possible, that were equipped to this card.
|
--真紅眼の黒刃竜
--Red-Eyes Slash Dragon
--Scripted by Sahim
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcCodeFun(c,CARD_REDEYES_B_DRAGON,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),1,true)
--Equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(s.ngcon)
e2:SetCost(s.ngcost)
e2:SetTarget(s.ngtg)
e2:SetOperation(s.ngop)
c:RegisterEffect(e2)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(s.eqcheck)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.spcon2)
e3:SetTarget(s.sptg2)
e3:SetOperation(s.spop2)
e3:SetLabelObject(e4)
c:RegisterEffect(e3)
end
s.listed_series={SET_RED_EYES}
s.listed_names={CARD_NECROVALLEY}
s.material_setcode=SET_RED_EYES
function s.eqcon(e)
return Duel.GetAttacker():IsSetCard(SET_RED_EYES)
end
function s.eqfilter(c,tp)
return c:IsRace(RACE_WARRIOR) and c:CheckUniqueOnField(tp) and c:IsMonster() and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.eqfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(c)
tc:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(200)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.ngcfilter(c,tp)
return c:IsControler(tp) and c:IsOnField()
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(s.ngcfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function s.ngfilter(c,e,tp)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
end
function s.ngcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.ngfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.ngfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.eqcheck(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then e:GetLabelObject():DeleteGroup() end
local g=e:GetHandler():GetEquipGroup()
g:KeepAlive()
e:SetLabelObject(g)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return (r&REASON_EFFECT+REASON_BATTLE)~=0
end
function s.spfilter2(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetLabelObject():GetLabelObject()
if chk==0 then return g and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:IsExists(s.spfilter2,1,nil,e,tp) and not Duel.IsEnvironment(CARD_NECROVALLEY) end
local sg=g:Filter(s.spfilter2,nil,e,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,#sg,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetTargetCards(e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
if #sg>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If a Level 8 or higher Dragon Synchro Monster is on the field, you can Special Summon this card (from your hand). You can only Special Summon "Red Nova" once per turn this way. If this card is sent to the GY for a Synchro Summon that uses 2 or more Tuner monsters as material: You can Special Summon 1 FIRE Fiend monster from your Deck in Defense Position.
|
--レッド・ノヴァ
--Red Nova
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--special summon (from deck)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(s.spdcon)
e2:SetTarget(s.spdtg)
e2:SetOperation(s.spdop)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsLevelAbove(8) and c:IsRace(RACE_DRAGON)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function s.spdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO and c:GetReasonCard():IsHasEffect(EFFECT_MULTIPLE_TUNERS)
end
function s.filter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FIEND)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.spdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 "HERO" monster you control; send it to the GY, also, after that, if it left the field by this effect, Special Summon 1 "Masked HERO" monster from your Extra Deck with the same Attribute that the sent monster had when it was on the field (its original Attribute, if face-down).
|
--マスク・チェンジ
--Mask Change
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_MASKED_HERO,SET_HERO}
function s.tfilter(c,att,e,tp,mc)
return c:IsSetCard(SET_MASKED_HERO) and c:IsAttribute(att) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(SET_HERO)
and Duel.IsExistingMatchingCard(s.tfilter,tp,LOCATION_EXTRA,0,1,nil,c:GetAttribute(),e,tp,c)
end
function s.chkfilter(c,att)
return c:IsFaceup() and c:IsSetCard(SET_HERO) and c:IsAttribute(att)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.chkfilter(chkc,e:GetLabel()) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
e:SetLabel(g:GetFirst():GetAttribute())
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local att=tc:GetAttribute()
if Duel.SendtoGrave(tc,REASON_EFFECT)==0 then return end
local g=Duel.GetMatchingGroup(s.tfilter,tp,LOCATION_EXTRA,0,nil,att,e,tp)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can banish 1 other card from your hand; Special Summon this card from your hand. You can banish 1 face-up Level 4 or lower monster you control; Special Summon 1 monster from your Deck with the same original Type and Attribute that the banished monster had on the field, but 1 or 2 Levels lower than its original Level. You can only use each effect of "Minimalian" once per turn.
|
--ミニマリアン
--Minimalian
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Special Summon this card from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.selfspcost)
e1:SetTarget(s.selfsptg)
e1:SetOperation(s.selfspop)
c:RegisterEffect(e1)
--Special Summon 1 monster from your Deck with the same original Type and Attribute that the banished monster had on the field, but 1 or 2 Levels lower than its original Level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCost(s.deckspcost)
e2:SetTarget(s.decksptg)
e2:SetOperation(s.deckspop)
c:RegisterEffect(e2)
end
function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
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)
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.deckspcostfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and c:IsLevelBelow(4) and c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalRace(),c:GetOriginalAttribute(),c:GetOriginalLevel())
end
function s.deckspfilter(c,e,tp,rac,att,lvl)
return c:IsOriginalRace(rac) and c:IsOriginalAttribute(att) and c:IsLevel(lvl-1,lvl-2)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.deckspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.deckspcostfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sc=Duel.SelectMatchingCard(tp,s.deckspcostfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
e:SetLabel(sc:GetOriginalRace(),sc:GetOriginalAttribute(),sc:GetOriginalLevel())
Duel.Remove(sc,POS_FACEUP,REASON_COST)
end
function s.decksptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.deckspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local rac,att,lvl=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,rac,att,lvl)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is face-up on the field, you can Normal Summon it to have it be treated as an Effect Monster with this effect: ● The original ATK of this card becomes 2100.
|
--巨人ゴーグル
--Goggle Golem
local s,id=GetID()
function s.initial_effect(c)
Gemini.AddProcedure(c)
--Original ATK becomes 2100
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(Gemini.EffectStatusCondition)
e1:SetValue(2100)
c:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be used as Synchro Material, except for the Synchro Summon of a "Majestic" monster.
|
--救世竜 セイヴァー・ドラゴン
--Majestic Dragon
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(s.synlimit)
c:RegisterEffect(e1)
end
s.listed_series={SET_MAJESTIC}
function s.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(SET_MAJESTIC)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"The Forgiving Maiden" + "Darklord Marie"
|
--聖女ジャンヌ
--St. Joan
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,84080938,57579381)
end
s.material_setcode=SET_DARKLORD
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Banish 1 "Reptilianne" monster from your GY; Special Summon 2 "Reptilianne Tokens" (Reptile/EARTH/Level 1/ATK 0/DEF 0).
|
--レプティレス・スポーン
--Reptilianne Spawn
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={TOKEN_REPTILIANNE}
s.listed_series={SET_REPTILIANNE}
function s.cfilter(c)
return c:IsSetCard(SET_REPTILIANNE) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>1
or (Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,SET_REPTILIANNE,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2
or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,SET_REPTILIANNE,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,TOKEN_REPTILIANNE)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1+ non-Tuner monsters When an opponent's Special Summoned monster declares an attack: You can return 1 "Altergeist" monster you control to the hand; negate that attack. If this card is Tributed and sent to the GY: You can Special Summon this card. You can only use each effect of "Altergeist Dragvirion" once per turn.
|
--オルターガイスト・ドラッグウィリオン
--Altergeist Dragvirion
--scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
--negate attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
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_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
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_ALTERGEIST}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:IsSpecialSummoned() and not at:IsControler(tp)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_ALTERGEIST) and c:IsMonster() and c:IsAbleToHandAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RELEASE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Plant monsters If your LP are higher than your opponent's, this card and any Plant monsters it points to cannot be destroyed by battle. You can Tribute 1 monster this card points to; Special Summon 1 Plant monster from your Deck in Defense Position. You can only use this effect of "Aromaseraphy Jasmine" once per turn. Once per turn, if you gain LP: Add 1 Plant monster from your Deck to your hand.
|
--アロマセラフィ-ジャスミン
--Aromaseraphy Jasmine
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_PLANT),2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetCondition(s.indcon)
e1:SetTarget(s.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--special summon from the deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--add to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.indcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)>Duel.GetLP(1-tp)
end
function s.indtg(e,c)
return e:GetHandler()==c or (c:IsRace(RACE_PLANT) and e:GetHandler():GetLinkedGroup():IsContains(c))
end
function s.cfilter(c,g)
return g:IsContains(c)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,lg) end
local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,lg)
Duel.Release(g,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function s.thfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Special Summoned. Must be Normal Summoned/Set by Tributing 3 monsters. If this card is Normal Summoned: Your opponent cannot activate Spell/Trap Cards until the end of their 2nd turn after this effect's activation. This card's ATK/DEF are equal to the highest ATK on the field +100, except "The Wicked Avatar".
|
--邪神アバター
--The Wicked Avatar
local s,id=GetID()
function s.initial_effect(c)
--Summon with 3 tribute
local e1=aux.AddNormalSummonProcedure(c,true,false,3,3)
local e2=aux.AddNormalSetProcedure(c,true,false,3,3)
--Cannot be Special Summoned
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--Increase its own ATK
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_REPEAT+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(s.adval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
c:RegisterEffect(e5)
--Prevent activations
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetOperation(s.regop)
c:RegisterEffect(e6)
--ATK check
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(id)
c:RegisterEffect(e7)
end
function s.filter(c)
return c:IsFaceup() and not c:IsHasEffect(id)
end
function s.adval(e,c)
local g=Duel.GetMatchingGroup(s.filter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g==0 then
return 100
else
local tg,val=g:GetMaxGroup(Card.GetAttack)
if not tg:IsExists(aux.TRUE,1,e:GetHandler()) then
g:RemoveCard(e:GetHandler())
tg,val=g:GetMaxGroup(Card.GetAttack)
end
return val+100
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(s.turncon)
e2:SetOperation(s.turnop)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,2)
Duel.RegisterEffect(e2,tp)
local descnum=tp==c:GetOwner() and 0 or 1
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetDescription(aux.Stringid(id,descnum))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(1082946)
e3:SetLabelObject(e2)
e3:SetOwnerPlayer(tp)
e3:SetOperation(s.reset)
e3:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,2)
c:RegisterEffect(e3)
end
function s.reset(e,tp,eg,ep,ev,re,r,rp)
s.turnop(e:GetLabelObject(),tp,eg,ep,ev,e,r,rp)
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.turncon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
function s.turnop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()+1
e:GetHandler():SetTurnCounter(ct)
if ct==2 then
e:GetLabelObject():Reset()
if re then re:Reset() end
else e:SetLabel(ct) end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Destroy 1 face-up monster on your side of the field to inflict 1000 points of damage to both players' Life Points.
|
--破壊指輪
--Destruction Ring
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,1000)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,1000,REASON_EFFECT,true)
Duel.Damage(tp,1000,REASON_EFFECT,true)
Duel.RDComplete()
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 "Noble Knight" monsters When this card is Xyz Summoned: You can target up to 3 "Noble Arms" Equip Spell Cards with different names in your Graveyard; equip those targets to this card. Once per turn: You can detach 1 Xyz Material from this card; destroy any number of Spell/Trap Cards on the field, up to the number of "Noble Arms" Equip Spell Cards you control.
|
--聖騎士王アルトリウス
--Artorigus, King of the Noble Knights
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon Procedure
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_NOBLE_KNIGHT),4,2)
--Equip to itself up to 3 "Noble Arms" Equip Spell Cards from the GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Destroy Spell/Trap cards on the field up to the number of "Noble Arms" Equip Spell Cards you control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(Cost.DetachFromSelf(1,1,nil))
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.listed_series={SET_NOBLE_ARMS,SET_NOBLE_KNIGHT}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsXyzSummoned()
end
function s.filter(c,e,tp,ec)
return c:IsSetCard(SET_NOBLE_ARMS) and c:IsCanBeEffectTarget(e) and c:CheckUniqueOnField(tp) and c:CheckEquipTarget(ec)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil,e,tp,c)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc,e,tp,c) end
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),3)
if chk==0 then return ft>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler()) end
local eg=aux.SelectUnselectGroup(g,e,tp,1,ft,aux.dncheck,1,tp,HINTMSG_EQUIP)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,eg,#eg,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=Duel.GetTargetCards(e)
if #g==0 or ft<#g then return end
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
for tc in g:Iter() do
Duel.Equip(tp,tc,c,true,true)
end
Duel.EquipComplete()
end
function s.nbarmsfilters(c)
return c:IsFaceup() and c:IsEquipSpell() and c:IsSetCard(SET_NOBLE_ARMS)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.nbarmsfilters,tp,LOCATION_SZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(s.nbarmsfilters,tp,LOCATION_SZONE,0,nil)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,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:
|
1 Rock monster + 1 Level 7 or higher monster in your opponent's GY Must first be Special Summoned with "Fossil Fusion". Before damage calculation, if this card battles an opponent's monster: You can switch the current ATK and DEF of that opponent's monster until the end of that Damage Step. If this card attacks a Defense Position monster, inflict piercing battle damage. If this Fusion Summoned card battles an opponent's monster, any battle damage it inflicts to your opponent is doubled.
|
--古生代化石竜 スカルギオス
--Fossil Dragon Skullgios
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Fusion Materials: 1 Rock monster + 1 Level 7 or higher monster in your opponent's GY
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsRace,RACE_ROCK),s.matfilter)
--"Clock Lizard" check
Auxiliary.addLizardCheck(c)
--Must be Special Summoned with "Fossil Fusion"
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(aux.FossilLimit)
c:RegisterEffect(e0)
--Switch the current ATK and DEF of that opponent's monster this card is battling until the end of that Damage Step
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetCondition(s.switchcon)
e1:SetOperation(s.switchop)
c:RegisterEffect(e1)
--If this card attacks a Defense Position monster, inflict piercing battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
--If this Fusion Summoned card battles an opponent's monster, any battle damage it inflicts to your opponent is doubled
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e3:SetCondition(s.doubledamcon)
e3:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e3)
end
s.listed_names={CARD_FOSSIL_FUSION}
function s.matfilter(c,sc,st,tp)
return c:IsLevelAbove(7) and c:IsControler(1-tp) and c:IsLocation(LOCATION_GRAVE)
end
function s.switchcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsRelateToBattle() and bc:HasDefense() and not bc:IsAttack(bc:GetDefense()) and bc:IsControler(1-tp)
end
function s.switchop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsControler(1-tp) then
local atk=bc:GetAttack()
local def=bc:GetDefense()
--Switch the current ATK and DEF of that opponent's monster until the end of that Damage Step
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SWAP_ATTACK_FINAL)
e1:SetValue(def)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE)
bc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SWAP_DEFENSE_FINAL)
e2:SetValue(atk)
bc:RegisterEffect(e2)
end
end
function s.doubledamcon(e)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsFusionSummoned() and bc and bc:IsControler(1-e:GetHandlerPlayer())
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Discard 1 Spell Card from your hand to inflict 500 points of damage to your opponent's Life Points.
|
--零式魔導粉砕機
--Type Zero Magic Crusher
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE)
e2:SetCost(s.cost)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.costfilter(c)
return c:IsSpell() and c:IsDiscardable()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST|REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.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)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Dragon Tuner + 1+ non-Tuner Winged Beast monsters When this card is Synchro Summoned: You can target 1 Level 3 or lower Dragon "Dragunity" monster in your GY; equip that target to this card. Once per turn: You can send 1 Equip Card you control equipped to this card to the GY; double this card's ATK until the end of this turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--ドラグニティナイト-ヴァジュランダ
--Dragunity Knight - Vajrayana
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_WINGEDBEAST),1,99)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
aux.AddEREquipLimit(c,nil,s.eqval,Card.EquipByEffectAndLimitRegister,e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(s.atkcost)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
s.listed_series={SET_DRAGUNITY}
function s.eqval(ec,c,tp)
return ec:IsControler(tp) and ec:IsLevelBelow(3) and ec:IsSetCard(SET_DRAGUNITY) and ec:IsRace(RACE_DRAGON)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSynchroSummoned()
end
function s.filter(c)
return c:IsLevelBelow(3) and c:IsSetCard(SET_DRAGUNITY) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
c:EquipByEffectAndLimitRegister(e,tp,tc)
end
end
function s.cfilter(c,tp)
return c:IsAbleToGraveAsCost() and c:IsControler(tp)
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetEquipGroup():IsExists(s.cfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=c:GetEquipGroup():FilterSelect(tp,s.cfilter,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()*2)
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] Once per turn, during the End Phase, if your opponent activated a card or effect this turn that targeted 1 "Odd-Eyes" Pendulum Monster you controlled (and no other cards) while this card was in your Pendulum Zone: Special Summon this card, and if you do, place 1 face-up "Odd-Eyes" Pendulum Monster from your Extra Deck in your Pendulum Zone, except "Odd-Eyes Persona Dragon". ---------------------------------------- [ Monster Effect ] Once per turn (Quick Effect): You can target 1 face-up monster on the field that was Special Summoned from the Extra Deck; it has its effects negated, until the end of this turn.
|
--オッドアイズ・ペルソナ・ドラゴン
--Odd-Eyes Persona Dragon
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
Pendulum.AddProcedure(c)
--spsummon reg
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetOperation(s.regop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_PZONE)
e2:SetOperation(s.regop2)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
end
s.listed_series={SET_ODD_EYES}
s.listed_names={id}
function s.regfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and c:IsSetCard(SET_ODD_EYES)
end
function s.regop1(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp and #eg==1 and eg:IsExists(s.regfilter,1,nil,tp) then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1,ev)
end
end
function s.regop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chain_ct={c:GetFlagEffectLabel(id)}
for i=1,#chain_ct do
if chain_ct[i]==ev then
c:RegisterFlagEffect(id+1,RESETS_STANDARD_PHASE_END,0,1)
return
end
end
end
function s.penfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_ODD_EYES) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and not c:IsForbidden()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id+1)~=0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,s.penfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function s.disfilter(c)
return c:IsNegatableMonster() and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e2)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Banish 1 "World Legacy" monster from your hand or face-up from your field, then target 2 monsters in your GY; Special Summon them, but they cannot attack this turn.
|
--星遺物の導き
--World Legacy Landmark
local s,id=GetID()
function s.initial_effect(c)
--Special summon 2 monsters from GY
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_WORLD_LEGACY}
function s.cfilter(c,ft)
return c:IsSetCard(SET_WORLD_LEGACY) and c:IsMonster() and c:IsAbleToRemoveAsCost()
and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
and (ft>1 or (c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 and ft>0))
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
e:SetLabel(1)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,ft)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsMonster() 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
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local check=not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp)
if e:GetLabel()==1 then
e:SetLabel(0)
return ft>0 and check
else
return ft>1 and check
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetTargetCards(e)
if #g>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
if #g>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil)
end
local tc=g:GetFirst()
for tc in aux.Next(g) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
--Cannot attack this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3206)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1+ non-Tuner monsters Once per turn, during the Main Phase (Quick Effect): You can Tribute any number of "Fabled" monsters, and if you do, take control of that many face-up monsters your opponent controls, but their effects are negated. If this card is in your GY: You can target 1 other "Fabled" card in your GY; return this card to the Extra Deck, and if you do, add that target to your hand. You can only use this effect of "Fabled Levilazebul" once per turn.
|
--魔轟神レヴェルゼブル
--Fabled Levilazebul
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
--Tribute any number of "Fabled" monsters and take control of that many face-up monsters your opponent controls
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetTarget(s.cttg)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
--Return this card to the Extra Deck and add 1 other "Fabled" card from your GY to your hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_series={SET_FABLED}
function s.rlfilter(c,tp,chk)
return c:IsReleasableByEffect() and c:IsSetCard(SET_FABLED)
and (chk==1 or Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0)
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rlfilter,tp,LOCATION_MZONE,0,1,nil,tp,chk)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
end
function s.rlrescon(sg,e,tp)
return Duel.GetMZoneCount(tp,sg,tp,LOCATION_REASON_CONTROL)>=#sg
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,nil)
if #cg==0 then return end
local rg=Duel.GetMatchingGroup(s.rlfilter,tp,LOCATION_MZONE,0,nil,tp,1)
if #rg==0 then return end
local g=aux.SelectUnselectGroup(rg,e,tp,1,#cg,s.rlrescon,1,tp,HINTMSG_RELEASE)
if #g==0 or Duel.Release(g,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local ct=#og
if ct==0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local sg=(cg-og):Select(tp,ct,ct,nil)
if #sg==0 then return end
Duel.HintSelection(sg)
if Duel.GetControl(sg,tp)>0 then
Duel.GetOperatedGroup():ForEach(Card.NegateEffects,c)
end
end
function s.thfilter(c)
return c:IsSetCard(SET_FABLED) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) and chkc~=c end
if chk==0 then return c:IsAbleToExtra() and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,c,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsLocation(LOCATION_EXTRA) and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is Normal Summoned: You can add 1 "Electrode Beast Anion" from your Deck or GY to your hand, then immediately after this effect resolves, you can Normal Summon 1 Level 4 or lower Thunder monster, also you cannot Special Summon from the Extra Deck for the rest of this turn, except LIGHT Xyz Monsters. You can target 1 other Thunder monster you control that has a Level; this card's Level becomes that monster's until the end of this turn. You can only use each effect of "Electrode Beast Cation" once per turn.
|
--電極獣カチオン
--Electrode Beast Cation
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Add to the hand 1 "Electrode Beast Anion" from the Deck or GY and Normal Summon 1 Level 4 or lower Thunder monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Change its level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
end
s.listed_names={58680635} --"Electrode Beast Anion"
function s.thfilter(c)
return c:IsCode(58680635) 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)
Duel.SetPossibleOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_MZONE)
end
function s.nsfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_THUNDER) and c:IsSummonable(true,nil)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
--Cannot Special Summon from the Extra Deck, except LIGHT Xyz Monsters
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not (c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_XYZ)) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Clock Lizard check
aux.addTempLizardCheck(e:GetHandler(),tp,function(e,c) return not (c:IsOriginalAttribute(ATTRIBUTE_LIGHT) and c:IsOriginalType(TYPE_XYZ)) end)
--Add to the hand 1 "Electrode Beast Anion" from the Deck or GY
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 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
if Duel.IsExistingMatchingCard(s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sc=Duel.SelectMatchingCard(tp,s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil):GetFirst()
if sc then
Duel.BreakEffect()
Duel.Summon(tp,sc,true,nil)
end
end
end
end
function s.lvfilter(c,lv)
return c:IsFaceup() and c:IsRace(RACE_THUNDER) and c:HasLevel() and not c:IsLevel(lv)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local lv=c:GetLevel()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc~=c and s.lvfilter(chkc,lv) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,c,lv) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,c,lv)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
--This card's Level becomes the same as that monster's
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters If this card is Xyz Summoned: You can apply these effects, in sequence, based on the materials used. You can only use this effect of "Gunkan Suship Shirauo-class Carrier" once per turn. ● "Gunkan Suship Shari": Draw 1 card. ● "Gunkan Suship Shirauo": Add 1 "Gunkan" Spell/Trap from your Deck to your hand. While a face-up card is in a Field Zone, "Gunkan" monsters you control Special Summoned from the Extra Deck cannot be destroyed by your opponent's card effects, and gain ATK equal to their original DEF.
|
--空母軍貫-しらうお型特務艦
--Gunkan Suship Shirauo-class Carrier
--Scripted by DyXel
local CARD_SUSHIP_SHIRAUO=78362751
local s,id=GetID()
function s.initial_effect(c)
--Xyz Summon.
Xyz.AddProcedure(c,nil,4,2)
c:EnableReviveLimit()
--"Gunkan" monsters cannot be destroyed by opponent's effects
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetCondition(s.contcon)
e0:SetTarget(s.conttg)
e0:SetValue(aux.indoval)
c:RegisterEffect(e0)
--"Gunkan" monsters gain ATK equal to their original DEF
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(s.contcon)
e1:SetTarget(s.conttg)
e1:SetValue(function(_,c)return c:GetBaseDefense() end)
c:RegisterEffect(e1)
--Gains effects based on material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetLabel(0)
e2:SetCondition(s.regcon)
e2:SetTarget(s.regtg)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(s.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
s.listed_series={SET_GUNKAN}
s.listed_names={CARD_SUSHIP_SHARI,CARD_SUSHIP_SHIRAUO}
function s.contcon(e)
return Duel.IsExistingMatchingCard(Card.IsFaceup,0,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.conttg(e,c)
return c:IsSetCard(SET_GUNKAN) and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsXyzSummoned() and e:GetLabel()>0
end
function s.sfilter(c)
return c:IsSetCard(SET_GUNKAN) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
local effs=e:GetLabel()
if chk==0 then return ((effs&1)>0 and Duel.IsPlayerCanDraw(tp,1))
or ((effs&2)>0 and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil))
end
local cat=0
if (effs&1)>0 then
cat=CATEGORY_DRAW
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
if (effs&2)>0 then
cat=cat|CATEGORY_TOHAND|CATEGORY_SEARCH
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
e:SetCategory(cat)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local effs=e:GetLabel()
--"Gukan Suship Shari": Draw 1 card.
if (effs&1)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
--"Gukan Suship Shirauo": Add 1 "Gunkan" Spell/Trap from your Deck to your hand.
if (effs&2)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.valcheck(e,c)
local g=c:GetMaterial()
local effs=0
--Check for "Gukan Suship Shari":
if g:IsExists(Card.IsCode,1,nil,CARD_SUSHIP_SHARI) then effs=effs|1 end
--Check for "Gukan Suship Shirauo":
if g:IsExists(Card.IsCode,1,nil,CARD_SUSHIP_SHIRAUO) then effs=effs|2 end
e:GetLabelObject():SetLabel(effs)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can remove from play this card, and 1 face-up monster you control, to select 1 Synchro Monster in your Graveyard with a Level less than or equal to the combined original Levels of the other 2 monsters. Special Summon that Synchro Monster.
|
--ユニバード
--Unibird
local s,id=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeEffectTarget(e)
end
function s.cfilter(c,lv,ft)
return c:IsFaceup() and c:IsAbleToRemoveAsCost() and c:GetOriginalLevel()>=lv and (ft>0 or c:GetSequence()<5)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return sg:IsContains(chkc) and chkc:IsLevelBelow(e:GetLabel()) end
if #sg==0 then return false end
local mg,mlv=sg:GetMinGroup(Card.GetLevel)
local elv=e:GetHandler():GetOriginalLevel()
local lv=(elv>=mlv) and 1 or (mlv-elv)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>-1 and e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),lv,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),lv,ft)
local slv=elv+g:GetFirst():GetLevel()
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
e:SetLabel(slv)
local g=sg:FilterSelect(tp,Card.IsLevelBelow,1,1,nil,slv)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot 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. Once per turn: You can discard 1 "Toon" card, then activate 1 of these effects; ● Special Summon 1 Toon monster from your Deck, except "Toon Dark Magician", ignoring its Summoning conditions. ● Add 1 "Toon" Spell/Trap from your Deck to your hand.
|
--トゥーン・ブラック・マジシャン
--Toon Dark Magician
local s,id=GetID()
function s.initial_effect(c)
--Cannot attack the turn it is Summoned
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetCondition(function(e) return e:GetHandler():IsStatus(STATUS_SUMMON_TURN|STATUS_FLIP_SUMMON_TURN|STATUS_SPSUMMON_TURN) end)
c:RegisterEffect(e1)
--Can attack directly while you control "Toon World" and the opponent controls no Toon monsters
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetCondition(s.dircon)
c:RegisterEffect(e2)
--Activate 1 of these effects
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(s.effcost)
e3:SetTarget(s.efftg)
e3:SetOperation(s.effop)
c:RegisterEffect(e3)
end
s.listed_series={SET_TOON}
s.listed_names={15259703,id}
function s.dircon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,15259703),tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_TOON),tp,0,LOCATION_MZONE,1,nil)
end
function s.costfilter(c)
return c:IsSetCard(SET_TOON) and c:IsDiscardable()
end
function s.effcost(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_COST|REASON_DISCARD)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_TOON) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.thfilter(c)
return c:IsSetCard(SET_TOON) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
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_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif op==2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
--Special Summon 1 Toon monster from your Deck
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
elseif op==2 then
--Search 1 "Toon" Spell/Trap
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Offer 2 monsters on your side of the field as a Tribute to increase your Life Points by 1000 points.
|
--ヒステリック天使
--Hysteric Fairy
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RECOVER)
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.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,2,false,nil,nil) end
local g=Duel.SelectReleaseGroupCost(tp,nil,2,2,false,nil,nil)
Duel.Release(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(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 5 monsters Your opponent takes any effect damage you would have taken from their card effects, instead. When this card destroys an opponent's monster by battle and sends it to the Graveyard: You can detach 1 Xyz Material from this card; destroy all monsters on the field whose current ATK is less than or equal to the original ATK of the destroyed monster in the Graveyard.
|
--No.14 強欲のサラメーヤ
--Number 14: Greedy Sarameya
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,5,2)
c:EnableReviveLimit()
--reflect damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(s.refcon)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(aux.bdogcon)
e2:SetCost(Cost.DetachFromSelf(1))
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.xyz_number=14
function s.refcon(e,re,val,r,rp,rc)
return (r&REASON_EFFECT)~=0 and rp==1-e:GetHandlerPlayer()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=e:GetHandler():GetBattleTarget():GetBaseAttack()
if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttackBelow,atk),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,atk) end
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,atk),tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetHandler():GetBattleTarget():GetBaseAttack()
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,atk),tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Destroy all Machine monsters on the field.
|
--酸の嵐
--Acid Rain
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsFaceup()
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,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card can only be summoned by a Flip Summon. If summoned by a Normal Summon, the card is destroyed. If your opponent has 1 or more monsters under his/her control, the ATK of this card is decreased by 1000 points.
|
--ボアソルジャー
--Boar Soldier
local s,id=GetID()
function s.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--atk down
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:SetCondition(s.con)
e2:SetValue(-1000)
c:RegisterEffect(e2)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function s.con(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_MZONE)>0
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
The next battle or effect damage you take this turn will become 0. You can also immediately apply the following effect. ● Discard 1 card, and if you do, Special Summon 1 Level 1 "Purrely" monster from your Deck. A "Purrely" Xyz Monster that has this card as material gains the following effect. ● Once per turn, during your opponent's Standby Phase: You can draw 1 card.
|
--ピュアリィ・スリーピィメモリー
--Purrely Sleepy Memory
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--The next damage you take becomes 0, discard 1 card and Special Summon 1 "Purrely" monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Provide an effect to a "Purrely" Xyz monster with this card as material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE|PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and e:GetHandler():IsSetCard(SET_PURRELY) end)
e2:SetTarget(s.drwtg)
e2:SetOperation(s.drwop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PURRELY}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_PURRELY) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--The first battle or effect damage you would take becomes 0
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_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(s.damval)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Discard 1 card and Special Summon 1 "Purrely" monster from the Deck
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT|REASON_DISCARD,nil,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function s.damval(e,re,val,r,rp,rc)
local c=e:GetHandler()
if r&(REASON_BATTLE|REASON_EFFECT)>0 then
Duel.Hint(HINT_CARD,0,id)
e:Reset()
return 0
end
return val
end
function s.drwtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drwop(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 monster may attack your opponent's Life Points directly.
|
--レインボー・フラワー
--Rainbow Flower
local s,id=GetID()
function s.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 Beast or Beast-Warrior monster you control; equip this card to that target. It gains 800 ATK. If the equipped monster destroys your opponent's monster by battle and sends it to the GY: Draw 1 card.
|
--幻獣の角
--Horn of the Phantom Beast
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(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(aux.StatChangeDamageStepCondition)
e1:SetCost(aux.RemainFieldCost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST|RACE_BEASTWARRIOR)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) or not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
--draw
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_DRAW)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.drcon)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
--Atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(800)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(s.eqlimit)
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e3)
else
c:CancelToGrave(false)
end
end
function s.eqlimit(e,c)
return c:IsRace(RACE_BEAST|RACE_BEASTWARRIOR)
end
function s.drfilter(c,rc)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.drfilter,1,nil,e:GetHandler():GetEquipTarget())
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
While this card is an Equip Card, the equipped monster cannot be destroyed by card effects. You can only use each of the following effects of "Infernoble Knight Ogier" once per turn. If this card is Normal or Special Summoned: You can send 1 "Noble Arms" card, or 1 FIRE Warrior monster except "Infernoble Knight Ogier", from your Deck to the GY. If this card is in your GY: You can target 1 Warrior monster you control; equip this card to that monster you control.
|
--焔聖騎士-オジエ
--Infernoble Knight Ogier
--Logical Nonsense
--Substitute ID
local s,id=GetID()
function s.initial_effect(c)
--Upon normal summon, send 1 FIRE warrior or "Noble Arm" card from deck to GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--Same as above, but on special summon
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--If in the GY, equip this card to a warrior monster
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,{id,1})
e3:SetTarget(s.eqtg)
e3:SetOperation(s.eqop)
c:RegisterEffect(e3)
--A monster equipped with this card cannot be destroyed by card effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(1)
c:RegisterEffect(e4)
end
s.listed_names={id}
--Lists "Noble Arms" archetype
s.listed_series={SET_NOBLE_ARMS}
--Check for FIRE warrior monster (except for this card's name) or "Noble Arms" card
function s.tgfilter(c)
return ((c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE)) or c:IsSetCard(SET_NOBLE_ARMS)) and c:IsAbleToGrave() and not c:IsCode(id)
end
--Activation legality
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
--Send 1 FIRE warrior or "Noble Arm" card from deck to GY
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--Check for warrior monster
function s.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
--Activation legality
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
--If in the GY, equip this card to a warrior monster
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc and tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsFacedown() then
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
--Target is valid
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn, you can discard 1 card to Special Summon 1 "Moja" from your Deck.
|
--ビーストライカー
--Beast Striker
local s,id=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
s.listed_names={94878265}
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD)
end
function s.filter(c,e,tp)
return c:IsCode(94878265) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You can target 1 "Yosenju" card in your Pendulum Zone; for the rest of this turn, its Pendulum Scale becomes 11, also you cannot Special Summon monsters, except "Yosenju" monsters (even if this card leaves the field). During your End Phase: Return this card to the hand. You can only use each Pendulum Effect of "Mayosenju Hitot" once per turn. ---------------------------------------- [ Monster Effect ] Cannot be Special Summoned, except by Pendulum Summon. If this card is Normal or Special Summoned: You can target 1 card your opponent controls; return it to the hand. Each time a card(s) on the field is returned to the hand or Main Deck by your card effect, while this card is on the field: All "Yosenju" monsters you currently control gain 500 ATK. Once per turn, during the End Phase, if this card was Special Summoned this turn: Return it to the hand.
|
--魔妖仙獣 独眼群主
--Mayosenju Hitot
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon
Pendulum.AddProcedure(c)
--Change its scale to 11
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
--Return itself to the hand during the End Phase
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
e2:SetTarget(s.sthtg)
e2:SetOperation(s.sthop)
c:RegisterEffect(e2)
--Cannot be Special Summoned, except by Pendulum Summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(aux.penlimit)
c:RegisterEffect(e3)
--Return 1 card the opponent controls to the hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
--Increase the ATK of "Yosenju" monsters by 500
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,3))
e6:SetCategory(CATEGORY_ATKCHANGE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_TO_HAND)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.atkcond)
e6:SetOperation(s.atkop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_TO_DECK)
e7:SetCondition(s.atkcond2)
c:RegisterEffect(e7)
--Return itself to the hand during the End Phase of the turn it is Special Summoned
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(id,4))
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_PHASE+PHASE_END)
e8:SetCountLimit(1)
e8:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end)
e8:SetTarget(s.rettg)
e8:SetOperation(s.retop)
c:RegisterEffect(e8)
aux.GlobalCheck(s,function()
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetLabel(id)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
end)
end
s.listed_series={SET_YOSENJU}
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and chkc:IsSetCard(SET_YOSENJU) end
if chk==0 then return Duel.IsExistingTarget(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,SET_YOSENJU) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsSetCard,tp,LOCATION_PZONE,0,1,1,nil,SET_YOSENJU)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--Cannot Special Summon, except "Yosenju" monsters
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,4))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetTargetRange(1,0)
e0:SetTarget(s.splimit)
e0:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e0,tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
--Change Scales to 11
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(11)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
tc:RegisterEffect(e2)
end
end
function s.splimit(e,c)
return not c:IsSetCard(SET_YOSENJU)
end
function s.sthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.sthop(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
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() and chkc:IsController(1-tp) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function s.rtfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp
end
function s.atkcond(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.rtfilter,1,nil,e,tp)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_YOSENJU),tp,LOCATION_MZONE,0,nil)
if #g==0 then return end
for tc in g:Iter() do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(500)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.rtfilter2(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp and not c:IsLocation(LOCATION_EXTRA)
end
function s.atkcond2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.rtfilter2,1,nil,tp) and not eg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned: You can target 1 Level 2 Tuner in your GY; Special Summon it, but negate its effects. You can target any number of Tuners you control; change their Levels to 2, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters. You can only use each effect of "Mannadium Trisukta" once per turn.
|
--マナドゥム・トリロスークダ
--Mannadium Trisukta
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Synchro Summon Procedure
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
--Special Summon 1 Level 2 Tuner monster from the GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Change the levels of Tuner monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsLevel(2) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) 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.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
--Negate its effects
tc:NegateEffects(e:GetHandler())
end
Duel.SpecialSummonComplete()
end
function s.lvfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TUNER) and c:HasLevel() and c:GetLevel()~=2
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
local ct=Duel.GetMatchingGroupCount(s.lvfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,ct,nil)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--Cannot Special Summon from the Extra Deck, except Synchro Monsters
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,2))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetTargetRange(1,0)
e0:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_SYNCHRO) end)
e0:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e0,tp)
--Clock Lizard check
aux.addTempLizardCheck(c,tp,function(_,c) return not c:IsOriginalType(TYPE_SYNCHRO) end)
local g=Duel.GetTargetCards(e):Match(Card.IsFaceup,nil)
for tc in g:Iter() do
--Change their Levels to 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(2)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Each of your opponent's monsters in the same column as one of your "S-Force" monsters is banished when it leaves the field. If this card is Normal or Special Summoned: You can add 1 "S-Force" card from your Deck to your hand, except "S-Force Gravitino". You can only use this effect of "S-Force Gravitino" once per turn.
|
--S-Force グラビティーノ
--S-Force Gravitino
--Scripted by edo9300
local s,id=GetID()
function s.initial_effect(c)
--Search 1 "S-Force" card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Banish opponent's monsters in the same column as your "S-Force" monster when they leave the field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(LOCATION_REMOVED)
e3:SetTarget(aux.SForceTarget)
c:RegisterEffect(e3)
end
s.listed_series={SET_S_FORCE}
function s.thfilter(c)
return c:IsSetCard(SET_S_FORCE) 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:
|
To Tribute Summon this card face-up, you can Tribute Continuous Spell/Trap Card(s) you control, as well as monsters. Unaffected by the effects of cards with the same card type (Monster, Spell, and/or Trap) as the original card type of the cards Tributed for its Tribute Summon. Once per turn, during either player's turn, if you control this Tribute Summoned monster: You can banish 1 Continuous Spell/Trap Card from your Graveyard, then target 1 other card on the field; destroy it.
|
--真竜剣皇マスターP
--Master Peace, the True Dracoslaying King
local s,id=GetID()
function s.initial_effect(c)
--summon with s/t
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_CONTINUOUS))
e1:SetValue(POS_FACEUP)
c:RegisterEffect(e1)
--tribute check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(s.valcheck)
c:RegisterEffect(e2)
--immune reg
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(s.regcon)
e3:SetOperation(s.regop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e4:SetCondition(s.descon)
e4:SetCost(s.descost)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
function s.valcheck(e,c)
local g=c:GetMaterial()
local typ=0
for tc in g:Iter() do
typ=typ|(tc:GetOriginalType()&(TYPE_MONSTER|TYPE_SPELL|TYPE_TRAP))
end
e:SetLabel(typ)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsTributeSummoned()
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local typ=e:GetLabelObject():GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(s.efilter)
e1:SetLabel(typ)
c:RegisterEffect(e1)
if typ&TYPE_MONSTER~=0 then
c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
end
if typ&TYPE_SPELL~=0 then
c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
end
if typ&TYPE_TRAP~=0 then
c:RegisterFlagEffect(0,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,5))
end
end
function s.efilter(e,te)
return te:IsActiveType(e:GetLabel()) and te:GetOwner()~=e:GetOwner()
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsTributeSummoned()
end
function s.costfilter(c)
return c:IsType(TYPE_CONTINUOUS) 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_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Special Summon this card (from your hand or Deck) by sending 1 face-up "Dharc the Dark Charmer" and 1 face-up DARK monster from your Monster Zone to the GY. When Summoned this way: You can add 1 Level 3 or 4 LIGHT Spellcaster monster from your Deck to your hand. If this card Special Summoned by its own effect attacks a Defense Position monster, inflict piercing battle damage. * The above text is unofficial and describes the card's functionality in the OCG.
|
--凭依装着-达克
--Familiar-Possessed - Dharc
local s,id=GetID()
function s.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND|LOCATION_DECK)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
s.listed_names={19327348}
function s.spfilter1(c)
return c:IsFaceup() and c:IsCode(19327348) and c:IsAbleToGraveAsCost()
end
function s.spfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGraveAsCost()
end
function s.rescon(sg,e,tp,mg)
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg)
end
function s.chk(c,sg)
return c:IsCode(19327348) and sg:IsExists(Card.IsAttribute,1,c,ATTRIBUTE_DARK)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
local g1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_MZONE,0,nil)
local g=g1:Clone()
g:Merge(g2)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g1>0 and #g2>0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_MZONE,0,nil)
g1:Merge(g2)
local g=aux.SelectUnselectGroup(g1,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
end
return false
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.SendtoGrave(g,REASON_COST)
Duel.ShuffleDeck(tp)
--pierce
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE&~RESET_TOFIELD)
e:GetHandler():RegisterEffect(e1)
g:DeleteGroup()
end
function s.tfilter(c)
local lv=c:GetLevel()
return (lv==3 or lv==4) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.tfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control a "Magic Hand", "Fire Hand", or "Ice Hand", you can Special Summon this card (from your hand).
|
--プロミネンス・ハンド
--Prominence Hand
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:IsCode(22530212,68535320,95929069)
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:
|
This card requires a cost of 1000 of your own Life Points to attack.
|
--ダーク・エルフ
--Dark Elf
local s,id=GetID()
function s.initial_effect(c)
--attack cost
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_COST)
e1:SetCost(s.atcost)
e1:SetOperation(s.atop)
c:RegisterEffect(e1)
end
function s.atcost(e,c,tp)
return Duel.CheckLPCost(tp,1000)
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsAttackCostPaid()~=2 and e:GetHandler():IsLocation(LOCATION_MZONE) then
Duel.PayLPCost(tp,1000)
Duel.AttackCostPaid()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate this card by sending 1 face-up "Blaze Accelerator" you control to the GY. During your Main Phase: You can target 1 monster your opponent controls; send 1 Pyro monster from your hand to the GY, and if you do, destroy that target, and if you do that, inflict 500 damage to your opponent. Your monsters cannot attack the turn you activate this effect.
|
--ブレイズ・キャノン-トライデント
--Tri-Blaze Accelerator
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.listed_names={69537999}
function s.costfilter(c)
return c:IsFaceup() and c:IsCode(69537999) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_ATTACK)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.disfilter(c)
return c:IsRace(RACE_PYRO)
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.IsExistingMatchingCard(s.disfilter,tp,LOCATION_HAND,0,1,nil)
and 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)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function s.desop(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.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 DARK Tuner + 1 non-Tuner Dragon-Type monster Cannot be destroyed by battle. When this card destroys an opponent's monster by battle and sends it to the Graveyard: You can activate this effect; this card can make a second attack on an opponent's monster in a row. During your Standby Phase: You can target 1 face-up monster your opponent controls; its ATK becomes half its current ATK, and if it does, inflict damage to your opponent equal to that lost ATK.
|
--冥界濁龍 ドラゴキュートス
--Dragocytos Corrupted Nethersoul Dragon
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_DRAGON),1,1)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--chain attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(s.atcon)
e2:SetOperation(s.atop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetCountLimit(1)
e3:SetCondition(s.damcon)
e3:SetTarget(s.damtg)
e3:SetOperation(s.damop)
c:RegisterEffect(e3)
end
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() and c:CanChainAttack(2,true) and c:IsStatus(STATUS_OPPO_BATTLE)
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToBattle() then return end
Duel.ChainAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE)
c:RegisterEffect(e1)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:HasNonZeroAttack() end
if chk==0 then return Duel.IsExistingTarget(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,1,nil)
local atk=g:GetFirst():GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk/2)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local atk=tc:GetAttack()
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(atk/2)
tc:RegisterEffect(e1)
Duel.Damage(1-tp,atk/2,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Equip only to a monster you control. During your Main Phase: You can make all monsters your opponent currently controls lose ATK equal to half the equipped monster's ATK, until the end of this turn (even if this card leaves the field). If this card is sent to the GY while equipped to a monster: You can pay 1000 LP; return this card to your hand. You can only use each effect of "Archfiend's Staff of Despair" once per turn.
|
--デーモンの杖
--Archfiend's Staff of Despair
--Scripted by DyXel
local s,id=GetID()
function s.initial_effect(c)
aux.AddEquipProcedure(c,0)
--Make opponent's monsters lose ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetOperation(s.actop)
c:RegisterEffect(e1)
--Add this card from GY to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.retcon)
e2:SetCost(Cost.PayLP(1000))
e2:SetTarget(s.rettg)
e2:SetOperation(s.retop)
c:RegisterEffect(e2)
end
function s.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ec=c:GetEquipTarget()
if not ec then return end
local v=(ec:GetAttack()//2)*-1
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_SINGLE)
e:SetCode(EFFECT_UPDATE_ATTACK)
e:SetValue(v)
e:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e)
end
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:GetEquipTarget()~=nil
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
c:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can banish this card from your GY, then target 1 "Orcust" monster in your GY, except "Orcust Cymbal Skeleton"; Special Summon it, also you cannot Special Summon monsters for the rest of this turn, except DARK monsters. You can only use this effect of "Orcust Cymbal Skeleton" once per turn.
|
--オルフェゴール・スケルツォン
--Orcust Cymbal Skeleton
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.SelfBanish)
e1:SetCondition(s.spcon1)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.spcon2)
c:RegisterEffect(e2)
end
s.listed_series={SET_ORCUST}
s.listed_names={id}
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,CARD_ORCUSTRATED_BABEL)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,CARD_ORCUSTRATED_BABEL)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_ORCUST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is flipped face-up, this card cannot be destroyed by battle while it is face-up on the field. If this card is flipped face-up, during each player's End Phase: You gain 500 LP.
|
--アロマポット
--Aroma Jar
local s,id=GetID()
function s.initial_effect(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)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(s.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
--Recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.reccon)
e3:SetTarget(s.rectg)
e3:SetOperation(s.recop)
c:RegisterEffect(e3)
end
function s.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
end
function s.indcon(e)
return e:GetHandler():GetFlagEffect(id)~=0
end
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a Psychic-Type monster you control battles, during the Damage Step you can pay Life Points in multiples of 100 (max. 500) to have the monster it's battling lose that much ATK and DEF, until the End Phase.
|
--サイコ・コマンダー
--Psychic Commander
local s,id=GetID()
function s.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(tp) then
e:SetLabelObject(d)
return a:IsFaceup() and a:IsRace(RACE_PSYCHIC) and a:IsRelateToBattle() and d and d:IsFaceup() and d:IsRelateToBattle()
else
e:SetLabelObject(a)
return d and d:IsFaceup() and d:IsRace(RACE_PSYCHIC) and d:IsRelateToBattle() and a and a:IsFaceup() and a:IsRelateToBattle()
end
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return Duel.CheckLPCost(tp,100) and e:GetHandler():GetFlagEffect(id)==0
and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) end
local lp=Duel.GetLP(tp)-1
local alp=100
local maxpay=bc:GetAttack()
local def=bc:GetDefense()
if maxpay<def then maxpay=def end
if maxpay<lp then lp=maxpay end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
if lp>=500 then alp=Duel.AnnounceNumber(tp,100,200,300,400,500)
elseif lp>=400 then alp=Duel.AnnounceNumber(tp,100,200,300,400)
elseif lp>=300 then alp=Duel.AnnounceNumber(tp,100,200,300)
elseif lp>=200 then alp=Duel.AnnounceNumber(tp,100,200)
end
Duel.PayLPCost(tp,alp)
e:SetLabel(-alp)
e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_DAMAGE,0,1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject()
if chkc then return chkc==tc end
if chk==0 then return tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not tc or not tc:IsRelateToEffect(e) or not tc:IsControler(1-tp) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(e:GetLabel())
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can only activate this card if there are 30 or more cards in your Graveyard. Inflict 3000 points of damage to your opponent's Life Points.
|
--残骸爆破
--Blasting the Ruins
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=30
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(3000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,3000)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When an opponent's monster declares an attack while they control 3 or more Attack Position monsters: Destroy all Attack Position monsters your opponent controls.
|
--閃光のバリア-シャイニング・フォース-
--Radiant Mirror Force
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.IsExistingMatchingCard(Card.IsPosition,tp,0,LOCATION_MZONE,3,nil,POS_FACEUP_ATTACK)
end
function s.filter(c)
return c:IsAttackPos()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,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:
|
Gain 1000 Life Points for each face-up Psychic-Type monster you control.
|
--サイコ・ヒーリング
--Psychic Rejuvenation
local s,id=GetID()
function s.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
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.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),tp,LOCATION_MZONE,0,1,nil) end
Duel.SetTargetPlayer(tp)
local rec=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),tp,LOCATION_MZONE,0,nil)*1000
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local rec=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),tp,LOCATION_MZONE,0,nil)*1000
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Recover(p,rec,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You cannot Pendulum Summon monsters, except "Yang Zing" and "Zefra" monsters. This effect cannot be negated. ---------------------------------------- [ Monster Effect ] If this card is Pendulum Summoned, or Special Summoned from the Main Deck: You can target 1 "Yang Zing" or "Zefra" monster you control, except "Zefraxi, Treasure of the Yang Zing"; that face-up monster is treated as a Tuner this turn, also place this card on the bottom of the Deck when it leaves the field. You can only use this effect of "Zefraxi, Treasure of the Yang Zing" once per turn.
|
--宝竜星-セフィラフウシ
--Zefraxi, Treasure of the Yang Zing
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon procedure
Pendulum.AddProcedure(c)
--You cannot Pendulum Summon monsters, except "Yang Zing" and "Zefra" 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,sump,sumtype,sumpos,targetp) return sumtype&SUMMON_TYPE_PENDULUM==SUMMON_TYPE_PENDULUM and not c:IsSetCard({SET_YANG_ZING,SET_ZEFRA}) end)
c:RegisterEffect(e1)
--Treat 1 "Yang Zing" or "Zefra" monster you control, except "Zefraxi, Treasure of the Yang Zing", as a Tuner this turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetCondition(s.tunercon)
e2:SetTarget(s.tunertg)
e2:SetOperation(s.tunerop)
c:RegisterEffect(e2)
end
s.listed_series={SET_YANG_ZING,SET_ZEFRA}
s.listed_names={id}
function s.tunercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPendulumSummoned() or c:IsSummonLocation(LOCATION_DECK)
end
function s.tunerfilter(c)
return c:IsSetCard({SET_YANG_ZING,SET_ZEFRA}) and not c:IsType(TYPE_TUNER) and c:IsFaceup() and not c:IsCode(id)
end
function s.tunertg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tunerfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tunerfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.tunerfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.tunerop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
--That face-up monster is treated as a Tuner this turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
if c:IsRelateToEffect(e) then
--Place this card on the bottom of the Deck when it leaves the field
local e2=Effect.CreateEffect(c)
e2:SetDescription(3301)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetValue(LOCATION_DECKBOT)
e2:SetReset(RESET_EVENT|RESETS_REDIRECT)
c:RegisterEffect(e2)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Ritual Summon this card with any "Gishki" Ritual Spell Card. Once per turn: You can declare 1 card type (Monster, Spell, or Trap); your opponent can discard 1 card to negate this card's effect, otherwise both players send 1 card of the declared type from their Main Deck to the Graveyard.
|
--イビリチュア・テトラオーグル
--Evigishki Tetrogre
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Send to the GY 1 card from the opponent's Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_series={SET_GISHKI}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local ac=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))
e:SetLabel(ac)
Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.IsChainDisablable(0)
and Duel.SelectYesNo(1-tp,aux.Stringid(id,4)) then
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT|REASON_DISCARD)
return
end
local ty=TYPE_MONSTER
if e:GetLabel()==1 then ty=TYPE_SPELL
elseif e:GetLabel()==2 then ty=TYPE_TRAP end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_DECK,0,1,1,nil,ty)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(1-tp,Card.IsType,1-tp,LOCATION_DECK,0,1,1,nil,ty)
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters During either player's turn, when another card or effect is activated that targets exactly 1 card on the field (and no other cards): You can detach 1 Xyz Material from this card, then target another card on the field that would be an appropriate target for that card/effect; that card/effect now targets the new target.
|
--暗遷士 カンゴルゴーム
--Cairngorgon, Antiluminescent Knight
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,4,2)
c:EnableReviveLimit()
--replace
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.condition)
e1:SetCost(Cost.DetachFromSelf(1))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or #g~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsOnField()
end
function s.filter(c,ct)
return Duel.CheckChainTarget(ct,c)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=ev
local label=Duel.GetFlagEffectLabel(0,id)
if label then
if ev==(label>>16) then ct=(label&0xffff) end
end
if chkc then return chkc:IsOnField() and s.filter(chkc,ct) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),ct) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),ct)
local val=ct+(ev+1<<16)
if label then
Duel.SetFlagEffectLabel(0,21501505,val)
else
Duel.RegisterFlagEffect(0,21501505,RESET_CHAIN,0,1,val)
end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.