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:
|
1 Tuner + 1+ non-Tuner monsters Unaffected by card effects, except "Mathmech" cards, while in the Extra Monster Zone. If this card in the Extra Monster Zone battles an opponent's monster, any battle damage it inflicts to your opponent is doubled. If this card is destroyed by battle, or if this card in its owner's possession is destroyed by an opponent's card effect: You can add 1 "Mathmech" card from your Deck to your hand. You can only use this effect of "Geomathmech Final Sigma" once per turn.
|
--炎斬機ファイナルシグマ
--Geomathmech Final Sigma
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)
--Unaffected by card effects, except "Mathmech" cards, while in the Extra Monster Zone
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_EMZONE)
e1:SetValue(function(e,te) return not te:GetOwner():IsSetCard(SET_MATHMECH) end)
c:RegisterEffect(e1)
--If this card in the Extra Monster Zone battles an opponent's monster, any battle damage it inflicts to your opponent is doubled
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetCondition(function(e) local bc=e:GetHandler():GetBattleTarget() return bc and bc:IsControler(1-e:GetHandlerPlayer()) end)
e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e2)
--Add 1 "Mathmech" card from your Deck to your hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,id)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_series={SET_MATHMECH}
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp))
end
function s.thfilter(c)
return c:IsSetCard(SET_MATHMECH) 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:
|
When this card is Summoned: Target 1 face-up monster on the field; change its battle position.
|
--ガーゴイルの道化師
--Ryu-Kishin Clown
local s,id=GetID()
function s.initial_effect(c)
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.postg)
e1:SetOperation(s.posop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.filter(c)
return c:IsFaceup() and c:IsCanChangePosition()
end
function s.postg(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 true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,0)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Banish all other cards you control and in your hand (min.1 total); draw until you have 2 cards in your hand. * The above text is unofficial and describes the card's functionality in the OCG.
|
--天よりの宝札
--Card of Sanctity
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND|LOCATION_ONFIELD,0,e:GetHandler())
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 Duel.IsPlayerCanDraw(tp) end
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2-ht)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2-ht)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ht<2 then
Duel.Draw(p,2-ht,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When you take battle damage while you control no monsters: Gain LP equal to the battle damage you took, and if you do, Special Summon 1 "Malus Token" (Fiend/DARK/Level 1/ATK ?/DEF ?). Its ATK/DEF are each equal to the amount of LP you gained by this effect.
|
--フリッグのリンゴ
--The Golden Apples
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={42671152}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,-2,-2,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local rec=Duel.Recover(tp,ev,REASON_EFFECT)
if rec~=ev or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,-2,-2,1,RACE_FIEND,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,id+1)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ev)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
token:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: Target 1 Special Summoned monster on the field; shuffle that target into the Deck.
|
--ヴェルズ・アザトホース
--Evilswarm Azzathoth
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsSpecialSummoned() and c:IsAbleToDeck()
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 true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
By Tributing this card while "Neo Space" is on the field, Special Summon 1 "Neo-Spacian Aqua Dolphin" from your hand or Deck.
|
--C・ドルフィーナ
--Chrysalis Dolphin
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:SetCondition(s.spcon)
e1:SetCost(Cost.SelfTribute)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
s.listed_names={17955766,42015635}
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(42015635)
end
function s.spfilter(c,e,tp)
return c:IsCode(17955766) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsEnvironment(42015635) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card cannot be Special Summoned. You can Normal Summon this card with 1 Tribute. If you do, it becomes Level 5 and its original ATK and DEF are halved.
|
--地獄からの使い
--Emissary from Pandemonium
local s,id=GetID()
function s.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCondition(s.sumcon)
e2:SetOperation(s.sumop)
e2:SetValue(SUMMON_TYPE_TRIBUTE)
c:RegisterEffect(e2)
end
function s.sumcon(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,1,1)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON|REASON_MATERIAL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(5)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE&~RESET_TOFIELD)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(1300)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(900)
c:RegisterEffect(e3)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Return all Spell and Trap Cards on the field to the hand.
|
--ハリケーン
--Giant Trunade
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsSpellTrap() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Special Summon 1 "Mikanko" monster from your hand or Deck, then you can equip it with 1 Equip Spell from your hand or GY that can equip to that monster. Banish that monster when it leaves the field. You can only activate 1 "Mikanko Promise" per turn.
|
--御巫の契り
--Mikanko Promise
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Special Summon 1 "Mikanko" monster from hand or Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_MIKANKO}
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_MIKANKO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.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_EQUIP,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.eqfilter(c,tc,tp)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(tc) and c:CheckUniqueOnField(tp)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
--Banish it if it leaves the field
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3300)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
--Equip the summoned monster with an appropriate Equip Spell
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,nil,tc,tp)
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=tg:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.Equip(tp,sg:GetFirst(),tc)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
The equipped monster gains 900 ATK for each card in either Graveyard that has the same name it does.
|
--守護神の矛
--Phalanx Pike
local s,id=GetID()
function s.initial_effect(c)
aux.AddEquipProcedure(c)
--Atk,def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(s.value)
c:RegisterEffect(e2)
end
function s.value(e,c)
return Duel.GetMatchingGroupCount(Card.IsCode,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,c:GetCode())*900
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Scrap Synchron" + 1+ non-Tuner monsters If this card is Synchro Summoned: You can add to your hand, or send to the GY, 1 "Junk Synchron" or 1 card that mentions "Junk Warrior" from your Deck. You can only use this effect of "Scrap Warrior" once per turn. The activated effects of monsters that mention "Junk Warrior", and Synchro Monsters with "Warrior" in their original names, that you control cannot be negated, except "Scrap Warrior".
|
--スクラップ・ウォリアー
--Scrap Warrior
--Scripted by the Razgriz
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Synchro Summon procedure: "Scrap Synchron" + 1+ non-Tuner monsters
Synchro.AddProcedure(c,s.tunerfilter,1,1,Synchro.NonTuner(nil),1,99)
--Add to your hand, or send to the GY, 1 "Junk Synchron" or 1 card that mentions "Junk Warrior" from your Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end)
e1:SetTarget(s.thtgtg)
e1:SetOperation(s.thtgop)
c:RegisterEffect(e1)
--The activated effects of monsters that mention "Junk Warrior", and Synchro Monsters with "Warrior" in their original names, that you control cannot be negated, except "Scrap Warrior"
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.effval)
c:RegisterEffect(e2)
end
s.material={16449363} --"Scrap Synchron"
s.listed_series={SET_WARRIOR}
s.listed_names={16449363,CARD_JUNK_SYNCHRON,CARD_JUNK_WARRIOR,id}
s.material_setcode=SET_SYNCHRON
function s.tunerfilter(c,lc,stype,tp)
return c:IsSummonCode(lc,stype,tp,16449363) or c:IsHasEffect(20932152)
end
function s.thtgfilter(c)
return (c:IsCode(CARD_JUNK_SYNCHRON) or c:ListsCode(CARD_JUNK_WARRIOR)) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function s.thtgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thtgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.thtgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
local g=Duel.SelectMatchingCard(tp,s.thtgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
aux.ToHandOrElse(g,tp)
end
end
function s.effval(e,ct)
local trig_e,trig_p,trig_loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
if not (trig_p==e:GetHandlerPlayer() and (trig_loc&LOCATION_MZONE)>0) then return false end
local trig_c=trig_e:GetHandler()
return (trig_c:ListsCode(CARD_JUNK_WARRIOR) or (trig_c:IsSynchroMonster() and trig_c:IsOriginalSetCard(SET_WARRIOR))) and not trig_c:IsCode(id)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: You can target 1 monster your opponent controls; banish it. You can only use this effect of "Subterror Behemoth Umastryx" once per turn. When a face-up monster you control is flipped face-down, if you control no face-up monsters: You can Special Summon this card from your hand in Defense Position. Once per turn: You can change this card to face-down Defense Position.
|
--サブテラーマリス・リグリアード
--Subterror Behemoth Umastryx
local s,id=GetID()
function s.initial_effect(c)
--Banish 1 monster your opponent controls
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
c:RegisterEffect(e1)
--Special Summon this card from your hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Change this card to face-down Defense Position
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.postg)
e3:SetOperation(s.posop)
c:RegisterEffect(e3)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsFacedown() and c:IsControler(tp)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) 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_DEFENSE)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD&~RESET_TURN_SET)|RESET_PHASE|PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Clock Wyvern" + 1+ Link Monsters When this card is Fusion Summoned, you can: Send cards from the top of your Deck to the GY, equal to the total Link Rating of the materials used for this card's Fusion Summon, also, until the end of the next turn, other monsters you control cannot attack, also this card gains 1000 ATK for each card sent to the GY by this effect. While you control a Link Monster(s), your opponent's monsters cannot target other monsters you control for attacks, also your opponent cannot target other monsters you control with card effects. If this Fusion Summoned card you control is sent to your GY by an opponent's card effect: You can add 1 Spell from your Deck to your hand. * The above text is unofficial and describes the card's functionality in the OCG.
|
--サイバース・クロック・ドラゴン
--Cyberse Clock Dragon
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Fusion.AddProcMixRep(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_LINK),1,99,21830679)
--mill and atk
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.gycon)
e1:SetTarget(s.gytg)
e1:SetOperation(s.gyop)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(s.tgcon)
e2:SetTarget(s.tgtg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--atk limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(s.tgcon)
e3:SetValue(s.tgtg)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(s.thcon)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
end
function s.gycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFusionSummoned()
end
function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetMaterial():Filter(Card.IsType,nil,TYPE_LINK):GetSum(Card.GetLink)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,1,tp,ct*1000)
end
function s.gyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetMaterial():Filter(Card.IsType,nil,TYPE_LINK):GetSum(Card.GetLink)
if Duel.DiscardDeck(tp,ct,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)*1000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END,2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(s.ftarget)
e2:SetLabel(c:GetFieldID())
e2:SetReset(RESET_PHASE|PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function s.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function s.tgcon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,TYPE_LINK)
end
function s.tgtg(e,c)
return c~=e:GetHandler()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFusionSummoned() and rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function s.thfilter(c)
return c:IsSpell() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
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 Level 4 or lower "X-Saber" monster from your Deck.
|
--XX-セイバー エマーズブレイド
--XX-Saber Emmersblade
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_series={SET_X_SABER}
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:GetLevel()<=4 and c:IsSetCard(SET_X_SABER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters Cannot be destroyed by battle with a monster Special Summoned from the GY. You can only use each of the following effects of "Exosister Mikailis" once per turn. If you control this card that was Xyz Summoned this turn by using an "Exosister" monster as material (Quick Effect): You can target 1 card your opponent controls or in their GY; banish it. You can detach 1 material from this card; add 1 "Exosister" Spell/Trap from your Deck to your hand.
|
--エクソシスター・ミカエリス
--Exosister Mikailis
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--2 Level 4 monsters
Xyz.AddProcedure(c,nil,4,2)
--Check materials on Xyz Summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(s.valcheck)
c:RegisterEffect(e0)
--Battle destruction immunity
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(function(_,c)return c:IsSpecialSummoned() and c:IsSummonLocation(LOCATION_GRAVE)end)
c:RegisterEffect(e1)
--Banish 1 card the opponent controls
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e2:SetCondition(function(e) return e:GetHandler():GetFlagEffect(id)>0 end)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
--Search 1 "Exosister" Spell/Trap
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,{id,1})
e3:SetCost(Cost.DetachFromSelf(1))
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_series={SET_EXOSISTER}
function s.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsSetCard,1,nil,SET_EXOSISTER) then
c:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TOFIELD),EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE|LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE|LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE|LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.thfilter(c)
return c:IsSetCard(SET_EXOSISTER) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
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:
|
2 Level 4 Dinosaur monsters When another monster's effect is activated (Quick Effect): You can detach 1 material from this card; negate the activation, and if you do, destroy that monster.
|
--エヴォルカイザー・ドルカ
--Evolzar Dolkka
local s,id=GetID()
function s.initial_effect(c)
--Xyz Summon
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DINOSAUR),4,2)
c:EnableReviveLimit()
--Negate monster activation
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition)
e1:SetCost(Cost.DetachFromSelf(1,1,nil))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return re~=e and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsMonsterEffect() and Duel.IsChainNegatable(ev)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
local rc=re:GetHandler()
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate this card by targeting 1 Synchro Monster you control; it cannot be destroyed by battle or your opponent's card effects. At the start of the Damage Step, if it battles an opponent's Level 5 or higher monster: You can destroy that opponent's monster, and if you do, the targeted Synchro Monster gains ATK equal to the original ATK of the destroyed monster, until the end of this turn. When that monster leaves the field, destroy this card.
|
--追走の翼
--Follow Wing
local s,id=GetID()
function s.initial_effect(c)
aux.AddPersistentProcedure(c,0,s.filter,nil,nil,nil,TIMINGS_CHECK_MONSTER_E)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(aux.PersistentTargetFilter)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(s.efilter)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,0))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLE_START)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(s.atkcon)
e5:SetOperation(s.atkop)
c:RegisterEffect(e5)
--Destroy2
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_SZONE)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetCondition(s.descon2)
e7:SetOperation(s.desop2)
c:RegisterEffect(e7)
end
function s.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function s.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if not tc then return false end
local bc=tc:GetBattleTarget()
return tc:IsLocation(LOCATION_MZONE) and bc and bc:IsFaceup() and bc:IsLocation(LOCATION_MZONE) and bc:IsLevelAbove(5)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=c:GetFirstCardTarget()
if not tc then return false end
local bc=tc:GetBattleTarget()
local atk=bc:GetBaseAttack()
if bc:IsRelateToBattle() and Duel.Destroy(bc,REASON_EFFECT)~=0 and bc:IsMonster() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function s.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Special Summon 1 monster from your hand. While it is face-up on your field, you take no damage. When it leaves the field, your opponent wins the Duel.
|
--魂のリレー
--Relay Soul
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetTargetRange(1,0)
e1:SetCondition(s.con)
e1:SetValue(0)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetLabel(1-tp)
e3:SetOperation(s.leaveop)
e3:SetReset(RESET_EVENT|RESET_OVERLAY|RESET_MSCHANGE|RESET_TURN_SET)
tc:RegisterEffect(e3,true)
end
Duel.SpecialSummonComplete()
end
function s.con(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function s.leaveop(e,tp,eg,ep,ev,re,r,rp)
Duel.Win(e:GetLabel(),WIN_REASON_RELAY_SOUL)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you activate a Trap Card (except during the Damage Step): You can Special Summon this card from your hand. If this card is Special Summoned: You can Special Summon 1 "Altergeist" monster from your Deck in Defense Position, except "Altergeist Multifaker". You cannot Special Summon monsters the turn you activate this effect, except "Altergeist" monsters. You can only use each effect of "Altergeist Multifaker" once per turn.
|
--オルターガイスト・マルチフェイカー
--Altergeist Multifaker
local s,id=GetID()
function s.initial_effect(c)
--special summon procedure
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_CHAIN_SOLVED)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.spcon1)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,{id,1})
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
s.listed_series={SET_ALTERGEIST}
s.listed_names={id}
function s.counterfilter(c)
return c:IsSetCard(SET_ALTERGEIST)
end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect()
and rp==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 c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(id,2))
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(SET_ALTERGEIST)
end
function s.filter(c,e,tp)
return c:IsSetCard(SET_ALTERGEIST) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
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.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.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 face-up monster you control and 1 face-up monster your opponent controls; the ATK of the first target becomes equal to the original ATK of the second target, until the end of this turn.
|
--極星宝ブリージンガ・メン
--Nordic Relic Brisingamen
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(aux.StatChangeDamageStepCondition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g1=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local sc=g:GetNext()
if tc:IsFacedown() or not tc:IsRelateToEffect(e)
or sc:IsFacedown() or not sc:IsRelateToEffect(e) then return end
local ac=e:GetLabelObject()
if tc==ac then tc=sc end
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESETS_STANDARD_PHASE_END)
ac:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Junk Synchron" + 1+ non-Tuner monsters Once per turn: You can target 1 monster your opponent controls; banish it. The banished monster returns to the opponent's field during the End Phase of this turn.
|
--ジャンク・アーチャー
--Junk Archer
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Synchro Summon procedure: "Junk Synchron" + 1+ non-Tuner monsters
Synchro.AddProcedure(c,s.tunerfilter,1,1,Synchro.NonTuner(nil),1,99)
--Banish 1 monster your opponent controls until the End Phase of this turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
c:RegisterEffect(e1)
end
s.material={CARD_JUNK_SYNCHRON}
s.listed_names={CARD_JUNK_SYNCHRON}
s.material_setcode=SET_SYNCHRON
function s.tunerfilter(c,lc,stype,tp)
return c:IsSummonCode(lc,stype,tp,CARD_JUNK_SYNCHRON) or c:IsHasEffect(20932152)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
--Banish it until the End Phase of this turn
aux.RemoveUntil(tc,nil,REASON_EFFECT,PHASE_END,id,e,tp,aux.DefaultFieldReturnOp)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
(This card is always treated as a "Constellar" card.) If this card is Summoned: You can target cards on the field, up to the number of LIGHT and DARK Xyz Monsters you control; destroy them. If a "tellarknight" or "Constellar" monster(s) is Special Summoned to your field, except "Tellarknight Altairan" (except during the Damage Step): You can Special Summon this card from your GY, also you cannot declare attacks for the rest of this turn, except with Xyz Monsters. You can only use each effect of "Tellarknight Altairan" once per turn.
|
--星騎士 アルテア
--Tellarknight Altairan
--Scripted by Satella
local s,id=GetID()
function s.initial_effect(c)
--Destroy cards on the field up to the number of LIGHT and DARK Xyz Monsters you control
local e1a=Effect.CreateEffect(c)
e1a:SetDescription(aux.Stringid(id,0))
e1a:SetCategory(CATEGORY_DESTROY)
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1a:SetCode(EVENT_SUMMON_SUCCESS)
e1a:SetCountLimit(1,id)
e1a:SetTarget(s.destg)
e1a:SetOperation(s.desop)
c:RegisterEffect(e1a)
local e1b=e1a:Clone()
e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1b)
local e1c=e1a:Clone()
e1c:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1c)
--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_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_series={SET_CONSTELLAR,SET_TELLARKNIGHT}
s.listed_names={id}
function s.ctfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetCards(e)
if #tg>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function s.spconfilter(c,tp)
return c:IsSetCard({SET_TELLARKNIGHT,SET_CONSTELLAR}) and c:IsControler(tp) and c:IsFaceup() and not c:IsCode(id)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spconfilter,1,nil,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) 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
aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,2),nil)
--You cannot declare attacks for the rest of this turn, except with Xyz Monsters
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(function(e,c) return not c:IsType(TYPE_XYZ) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Look at your opponent's hand. Select 1 card among them and return it to his/her Deck. The Deck is then shuffled.
|
--強引な番兵
--The Forceful Sentry
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if #g>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleHand(1-p)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can increase the Levels of all Machine-Type monsters you currently control by 1. If this card attacks a Defense Position monster, inflict piercing battle damage to your opponent. If this card attacks, it is changed to Defense Position at the end of the Damage Step.
|
--穿孔重機ドリルジャンボ
--Jumbo Drill
local s,id=GetID()
function s.initial_effect(c)
--lvup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.lvtg)
e1:SetOperation(s.lvop)
c:RegisterEffect(e1)
--to defense
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(s.poscon)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
end
function s.filter(c)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsRace(RACE_MACHINE)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Negate the effect of Spell and Trap Cards controlled by your opponent that target this face-up card on the field.
|
--幻影のゴラ亀
--Gora Turtle of Illusion
local s,id=GetID()
function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e1:SetTarget(s.distg)
c:RegisterEffect(e1)
--disable effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
--self destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e3:SetTarget(s.distg)
c:RegisterEffect(e3)
--Double Snare
aux.DoubleSnareValidity(c,LOCATION_MZONE)
end
function s.distg(e,c)
return c:IsControler(1-e:GetHandlerPlayer()) and c:IsHasCardTarget(e:GetHandler())
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsSpellTrapEffect() then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or #g==0 then return end
if g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
(Quick Effect): You can target 1 "Wind-Up" monster you control; banish it until your next Standby Phase. This effect can be used only once while this card is face-up on the field.
|
--ゼンマイラビット
--Wind-Up Rabbit
local s,id=GetID()
function s.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET+EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_series={SET_WIND_UP}
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_WIND_UP) and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,tc:GetPosition(),REASON_EFFECT|REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
if Duel.IsTurnPlayer(tp) then
if Duel.IsPhase(PHASE_DRAW) then
e1:SetLabel(Duel.GetTurnCount())
else
e1:SetLabel(Duel.GetTurnCount()+2)
end
else
e1:SetLabel(Duel.GetTurnCount()+1)
end
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetCondition(s.retcon)
e1:SetOperation(s.retop)
tc:RegisterEffect(e1)
end
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetHandler())
e:Reset()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is Normal Summoned: Inflict 600 damage to your opponent. If this card attacks, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step. Once per turn: You can Fusion Summon 1 "Ancient Gear" Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Materials.
|
--古代の機械猟犬
--Ancient Gear Hunting Hound
local s,id=GetID()
function s.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(s.aclimit)
e2:SetCondition(s.actcon)
c:RegisterEffect(e2)
--special summon
local params = {aux.FilterBoolFunction(Card.IsSetCard,SET_ANCIENT_GEAR)}
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(Fusion.SummonEffTG(table.unpack(params)))
e3:SetOperation(Fusion.SummonEffOP(table.unpack(params)))
c:RegisterEffect(e3)
end
s.listed_series={SET_ANCIENT_GEAR}
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function s.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You cannot Pendulum Summon monsters, except "Superheavy Samurai" monsters. This effect cannot be negated. Once per turn: You can target 1 "Superheavy Samurai" monster you control; increase its Level by 1 (even if this card leaves the field). ---------------------------------------- [ Monster Effect ] You can Tribute Summon this card by Tributing 1 "Superheavy Samurai" monster. When this card is Normal or Special Summoned: You can change its battle position. This card can attack while in face-up Defense Position. If it does, apply its DEF for damage calculation.
|
--超重輝将ヒス-E
--Superheavy Samurai General Jade
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Attributes
Pendulum.AddProcedure(c)
--Special Summon limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTargetRange(1,0)
e1:SetCondition(s.splimcon)
e1:SetTarget(s.splimit)
c:RegisterEffect(e1)
--Change level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
--Change position
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetTarget(s.postg)
e3:SetOperation(s.posop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--Summon with 1 tribute
local e5=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter)
local e6=aux.AddNormalSetProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter)
--Attack in defense
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_DEFENSE_ATTACK)
e7:SetValue(1)
c:RegisterEffect(e7)
end
s.listed_series={SET_SUPERHEAVY_SAMURAI}
function s.splimcon(e)
return not e:GetHandler():IsForbidden()
end
function s.splimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(SET_SUPERHEAVY_SAMURAI) and (sumtp&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_SUPERHEAVY_SAMURAI) and c:HasLevel()
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and 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_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function s.otfilter(c,tp)
return c:IsSetCard(SET_SUPERHEAVY_SAMURAI) and (c:IsControler(tp) or c:IsFaceup())
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Increase this card's ATK by 100 points for every Plant-Type monster that is face-up on the field.
|
--森の住人 ウダン
--Wodan the Resident of the Forest
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(s.value)
c:RegisterEffect(e1)
end
function s.value(e,c)
return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PLANT),0,LOCATION_MZONE,LOCATION_MZONE,nil)*100
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent Special Summons a monster(s): Activate this card by targeting 1 of those Summoned monsters in Attack Position, with less ATK than an "Evil Eye" monster you control; take control of that monster. When that monster leaves the field, destroy this card. While "Evil Eye of Selene" is in your Spell & Trap Zone, that targeted monster is also treated as an "Evil Eye" monster. You can only activate 1 "Evil Eye Mesmerism" per turn.
|
--死配の呪眼
--Evil Eye Mesmerism
local s,id = GetID()
function s.initial_effect(c)
--activate and use effect
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.target)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetLabelObject(e1)
e2:SetCondition(aux.PersistentTgCon)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(aux.PersistentTargetFilter)
e3:SetValue(s.tg)
c:RegisterEffect(e3)
--treats
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ADD_SETCODE)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(aux.PersistentTargetFilter)
e4:SetCondition(s.sccon)
e4:SetValue(SET_EVIL_EYE)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCondition(s.descon)
e5:SetOperation(s.desop)
c:RegisterEffect(e5)
end
s.listed_series={SET_EVIL_EYE}
s.listed_names={CARD_EVIL_EYE_SELENE}
function s.cfilter1(c)
return c:IsFaceup() and c:IsSetCard(SET_EVIL_EYE)
end
function s.cfilter2(c,e,tp,eg)
return c:IsSummonPlayer(1-tp) and c:IsCanBeEffectTarget(e) and c:IsControlerCanBeChanged() and c:IsPosition(POS_FACEUP_ATTACK)
and eg:IsExists(s.cfilter3,1,nil,c:GetAttack())
end
function s.cfilter3(c,atk)
return c:GetAttack()>atk
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_MZONE,0,nil)
if chkc then return s.cfilter2(chkc,e,tp,g) and eg:IsContains(chkc) end
if chk==0 then return eg and eg:IsExists(s.cfilter2,1,nil,e,tp,g) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local tg=eg:FilterSelect(tp,s.cfilter2,1,1,nil,e,tp,g)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tg,1,0,0)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):GetFirst()
if c:IsRelateToEffect(re) and tc and tc:IsRelateToEffect(re) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_OWNER_RELATE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp)
e1:SetReset(RESET_EVENT|RESETS_STANDARD&~RESET_TURN_SET)
e1:SetCondition(s.con)
tc:RegisterEffect(e1)
end
end
function s.con(e)
local c=e:GetOwner()
local h=e:GetHandler()
return c:IsHasCardTarget(h)
end
function s.tg(e,c)
return e:GetHandlerPlayer()
end
function s.sccon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_EVIL_EYE_SELENE),e:GetHandlerPlayer(),LOCATION_SZONE,0,1,nil)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=c:GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) by banishing 1 "Alpha The Electromagnet Warrior", "Beta The Electromagnet Warrior", and "Gamma The Electromagnet Warrior" from your hand, Graveyard, and/or face-up from your Monster Zone. You can banish 1 Level 4 or lower "Magnet Warrior" monster from your Graveyard, then target 1 card your opponent controls; destroy it. If this card is destroyed by battle, or if this card in its owner's possession is destroyed by an opponent's card effect: You can target 1 each of your banished "Alpha The Electromagnet Warrior", "Beta The Electromagnet Warrior", and "Gamma The Electromagnet Warrior"; Special Summon them.
|
--電磁石の戦士マグネット・ベルセリオン
--Berserkion the Electromagna Warrior
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(s.cost)
e2:SetTarget(s.target)
e2:SetOperation(s.activate)
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_DESTROYED)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(s.spcon2)
e3:SetTarget(s.sptg2)
e3:SetOperation(s.spop2)
c:RegisterEffect(e3)
end
s.listed_series={SET_MAGNET_WARRIOR}
s.listed_names={42023223,79418928,15502037}
function s.rescon(sg,e,tp,mg)
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.cchk1,1,nil,sg)
end
function s.cchk1(c,sg)
return c:IsCode(42023223) and sg:IsExists(s.cchk2,1,nil,sg)
end
function s.cchk2(c,sg)
return c:IsCode(79418928) and sg:FilterCount(s.cchk3,c)==1
end
function s.cchk3(c)
return c:IsCode(15502037)
end
function s.cfilter(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true,true)
end
function s.spcon(e,c)
local c=e:GetHandler()
if c==nil then return true end
local tp=c:GetControler()
local rg1=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,42023223)
local rg2=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,79418928)
local rg3=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,15502037)
local rg=rg1:Clone()
rg:Merge(rg2)
rg:Merge(rg3)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3 and #rg1>0 and #rg2>0 and #rg3>0
and aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local rg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,42023223)
rg:Merge(Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,79418928))
rg:Merge(Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_HAND,0,c,15502037))
local g=aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,1,tp,HINTMSG_REMOVE,nil,nil,true)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
end
return false
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function s.costfilter(c)
return c:IsMonster() and (c:IsSetCard(SET_MAGNET_WARRIOR) or c:IsCode(99785935,39256679,11549357)) and c:IsLevelBelow(4) 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.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE)
or (rp~=tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp))
end
function s.spfilter(c,e,tp,code)
return c:IsFaceup() and c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,42023223)
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,79418928)
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp,15502037)
and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,42023223)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,79418928)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,15502037)
g1:Merge(g2)
g1:Merge(g3)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,3,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetTargetCards(e)
if ft<=0 or #g==0 or #g>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
if #g<=ft then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ft,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_RULE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card destroys an opponent's monster by battle: You can add 1 Level 4 or lower Beast monster from your Deck to your hand.
|
--デスマニア・デビル
--Desmanian Devil
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(aux.bdocon)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_BEAST) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: You can Special Summon 1 monster from your hand. When your opponent activates a Normal Spell/Trap Card (Quick Effect): You can Tribute 1 other monster; the activated effect becomes "Change 1 face-up monster your opponent controls to face-down Defense Position". You can only use this effect of "Fairy Tail - Sleeper" once per turn.
|
--妖精伝姫-ターリア
--Fairy Tail - Sleeper
local s,id=GetID()
function s.initial_effect(c)
--FLIP: You can Special Summon 1 monster from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Change the activated effect of an opponent's Normal Spell/Trap to "Change 1 face-up monster your opponent controls to face-down Defense Position"
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.chcon)
e2:SetCost(s.chcost)
e2:SetTarget(s.chtg)
e2:SetOperation(s.chop)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.chcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rp==1-tp and rc:IsNormalSpellTrap() and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,c) end
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,c)
Duel.Release(g,REASON_COST)
end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanTurnSet,rp,0,LOCATION_MZONE,1,nil) end
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,s.repop)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsNormalSpellTrap() then
c:CancelToGrave(false)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send this card to the GY during your 2nd Standby Phase after activation. You can only use the following effect of "Photon Change" once per turn. Send 1 "Photon" or "Galaxy" monster you control to the GY to activate 1 of these effects, or, if you send "Galaxy-Eyes Photon Dragon", you can activate both, in sequence; ● Special Summon 1 "Photon" monster from your Deck with a different original name than the sent monster. ● Add 1 "Photon" card from your Deck to your hand, except "Photon Change".
|
--フォトン・チェンジ
--Photon Change
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:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target)
c:RegisterEffect(e1)
--Activate 1 of these effects, or, if you send "Galaxy-Eyes Photon Dragon", you can activate both, in sequence
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(s.effcost)
e2:SetTarget(s.efftg)
e2:SetOperation(s.effop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PHOTON,SET_GALAXY}
s.listed_names={CARD_GALAXYEYES_P_DRAGON}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
--Send this card to the GY during your 2nd Standby Phase after activation.
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,3)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
if s.effcost(e,tp,eg,ep,ev,re,r,rp,0)
and s.efftg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
s.effcost(e,tp,eg,ep,ev,re,r,rp,1)
s.efftg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetOperation(s.effop)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==2 then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESETS_STANDARD_PHASE_END,0,1)
end
function s.costfilter1(c,e,tp)
return c:IsAbleToGraveAsCost() and c:IsFaceup() and c:IsSetCard({SET_PHOTON,SET_GALAXY}) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function s.spfilter1(c,e,tp,code)
return c:IsSetCard(SET_PHOTON) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.costfilter2(c)
return c:IsFaceup() and c:IsSetCard({SET_PHOTON,SET_GALAXY}) and c:IsAbleToGraveAsCost()
end
function s.thfilter(c)
return c:IsSetCard(SET_PHOTON) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.costfilter3(c,e,tp)
return c:IsAbleToGraveAsCost() and c:IsFaceup() and c:IsCode(CARD_GALAXYEYES_P_DRAGON) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function s.spfilter2(c,e,tp,code)
return c:IsSetCard(SET_PHOTON) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c)
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.costfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.costfilter2,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.costfilter3,tp,LOCATION_MZONE,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)},
{b3,aux.Stringid(id,4)})
e:SetLabel(op)
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetValue(g:GetFirst():GetOriginalCode())
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter3,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetValue(g:GetFirst():GetOriginalCode())
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetValue())
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif op==3 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetValue())
if #g1>0 and Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g2>0 then
Duel.BreakEffect()
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Ritual Summon this card with "Underworld Ritual of Prediction". Must be Ritual Summoned, or Special Summoned with "Prediction Princess Tarotrei". You can only use each effect of "Prediction Princess Tarotreith" once per turn. (Quick Effect): You can activate 1 of these effects; ● Flip any number of face-down monsters you control to face-up Defense Position. ● Flip any number of face-up monsters you control to face-down Defense Position. FLIP: You can Special Summon 1 Flip monster from your Deck in face-down Defense Position.
|
--冥占術姫タロットレイス
--Prediction Princess Tarotreith
--Scripted by DyXel
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Special Summon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(s.spconvalue)
c:RegisterEffect(e0)
--FLIP: Special Summon 1 Flip monster from Deck.
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Flip face-up or face-down any number of monsters.
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER_E)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
end
s.listed_names={8428836,94997874}
function s.spconvalue(e,se,sp,st)
return aux.ritlimit(e,se,sp,st) or se:GetHandler():IsCode(94997874)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.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 sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,0,1,nil)
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)
local pos=op==1 and POS_FACEUP_DEFENSE or POS_FACEDOWN_DEFENSE
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,tp,pos)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if not op then return end
local filter=op==1 and Card.IsFacedown or s.posfilter
local g=Duel.GetMatchingGroup(filter,tp,LOCATION_MZONE,0,nil)
if #g==0 then return end
local pos=op==1 and POS_FACEUP_DEFENSE or POS_FACEDOWN_DEFENSE
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.ChangePosition(g:Select(tp,1,#g,nil),pos)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 1 "Mimighoul" monsters You can detach 1 material from this card; Special Summon 1 "Mimighoul Master" from your hand, Deck or GY. During the Main Phase (Quick Effect): You can target 1 "Mimighoul Master" you control; equip this card to it as an Equip Spell that gives it 1000 ATK, then you can return cards from the field to the hand, up to the number of materials this card had. You can only use 1 "Mimighoul Throne" effect per turn, and only once that turn.
|
--ミミグル・スローン
--Mimighoul Throne
--Scripted by the Razgriz
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure: 2 Level 1 "Mimighoul" monsters
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_MIMIGHOUL),1,2)
--Special Summon 1 "Mimighoul Master" from your hand, Deck or GY
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,id)
e1:SetCost(Cost.DetachFromSelf(1,1,nil))
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Equip this card to 1 "Mimighoul Master" you control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e2:SetCondition(function() return Duel.IsMainPhase() end)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
end
s.listed_series={SET_MIMIGHOUL}
s.listed_names={55537983} --"Mimighoul Master"
function s.spfilter(c,e,tp)
return c:IsCode(55537983) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsCode(55537983) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsCode,55537983),tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsCode,55537983),tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,0)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then
return Duel.SendtoGrave(c,REASON_RULE,PLAYER_NONE,PLAYER_NONE)
else
local ct=c:GetOverlayCount()
if not Duel.Equip(tp,c,tc) then return end
--Equip limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetValue(function(e,c) return c==tc end)
e0:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e0)
--The equipped monster gains 1000 ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
if ct==0 then return end
--Return cards on the field to the hand, up to the number of materials this card had
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:Select(tp,1,ct,nil)
Duel.HintSelection(sg)
Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can add 1 "Machina" monster from your Deck to your hand, except "Machina Gearframe". Once per turn, you can either: Target 1 Machine monster you control; equip this card to that target, OR: Unequip this card and Special Summon it. If the equipped monster would be destroyed by battle or card effect, destroy this card instead.
|
--マシンナーズ・ギアフレーム
--Machina Gearframe
local s,id=GetID()
function s.initial_effect(c)
aux.AddUnionProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),false)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.stg)
e1:SetOperation(s.sop)
c:RegisterEffect(e1)
end
s.listed_series={SET_MACHINA}
s.listed_names={id}
function s.sfilter(c)
return c:IsSetCard(SET_MACHINA) and c:GetCode()~=id and c:IsMonster() and c:IsAbleToHand()
end
function s.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.sop(e,tp,eg,ep,ev,re,r,rp)
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
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Tribute 1 FIRE monster; inflict damage to your opponent equal to that monster's original ATK.
|
--火霊術-「紅」
--Spiritual Fire Art - Kurenai
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1: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.CheckReleaseGroupCost(tp,Card.IsAttribute,1,false,nil,nil,ATTRIBUTE_FIRE) end
local g=Duel.SelectReleaseGroupCost(tp,Card.IsAttribute,1,1,false,nil,nil,ATTRIBUTE_FIRE)
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.Release(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(1-tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-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.Damage(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When you take damage from your opponent's card effect or their monster's attack: Apply the appropriate effect based on the type of damage. ● Battle: Special Summon 1 monster from your GY, with ATK less than or equal to the damage, and if you do, end the Battle Phase after the Damage Step. ● Effect: Inflict double the damage you took to your opponent. You can only activate 1 "Split Mirror of the Underworld" per turn.
|
--冥府の合わせ鏡
--Split Mirror of the Underworld
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Special Summon 1 monster, OR inflict damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_DAMAGE)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.actcon)
e1:SetTarget(s.acttg)
e1:SetOperation(s.actop)
c:RegisterEffect(e1)
end
function s.actcon(e,tp,eg,ep,ev,re,r,rp)
if ep==1-tp then return false end
if (r&REASON_EFFECT)==REASON_EFFECT then
return rp==1-tp
else
return Duel.GetAttacker():IsControler(1-tp)
end
end
function s.spfilter(c,e,tp,dam)
return c:IsAttackBelow(dam) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
local is_eff=(r&REASON_EFFECT)==REASON_EFFECT
if chk==0 then return is_eff or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,ev))
end
if is_eff then
e:SetCategory(CATEGORY_DAMAGE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev*2)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
end
function s.actop(e,tp,eg,ep,ev,re,r,rp)
if (r&REASON_EFFECT)==REASON_EFFECT then
Duel.Damage(1-tp,ev*2,REASON_EFFECT)
return
end
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_GRAVE,0,1,1,nil,e,tp,ev)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
--End the Battle Phase after the Damage Step
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetOperation(function() Duel.SkipPhase(Duel.GetTurnPlayer(),PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1) end)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Tribute 1 monster; Special Summon 3 "Nightmare Archfiend Tokens" (Fiend-Type/DARK/Level 6/ATK 2000/DEF 2000) to your opponent's field in Attack Position. Each time 1 is destroyed, its controller takes 800 damage.
|
--ナイトメア・デーモンズ
--Nightmare Archfiends
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
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={42956964}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,nil) end
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,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 not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>2
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_ARCHFIEND,TYPES_TOKEN,2000,2000,6,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP_ATTACK,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<3
or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_ARCHFIEND,TYPES_TOKEN,2000,2000,6,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP_ATTACK,1-tp) then return end
for i=1,3 do
local token=Duel.CreateToken(tp,id+1)
if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetOperation(s.damop)
token:RegisterEffect(e1,true)
end
end
Duel.SpecialSummonComplete()
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_DESTROY) then
Duel.Damage(c:GetPreviousControler(),800,REASON_EFFECT)
end
e:Reset()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can have this card gain 400 ATK. This card cannot attack the turn you activate this effect.
|
--アイアイアン
--Aye-Iron
local s,id=GetID()
function s.initial_effect(c)
--Gain 400 ATK, cannot attack this turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.cost)
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 e:GetHandler():GetAttackAnnouncedCount()==0 end
--Cannot attack this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3206)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetValue(400)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can flip this card into face-down Defense Position once per turn during your Main Phase. After you use this effect, rearrange the face-down Defense Position monsters in your Main Monster Zones, then return them in face-down Defense Position.
|
--さまようミイラ
--Wandering Mummy
local s,id=GetID()
function s.initial_effect(c)
--turn set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TURN_SET),0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function s.filter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)>0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card you control is destroyed and sent to the Graveyard, add 1 "Reptilianne" monster from your Deck to your hand.
|
--レプティレス・ガードナー
--Reptilianne Gardna
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
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_REPTILIANNE}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.filter(c)
return c:IsSetCard(SET_REPTILIANNE) and c:IsMonster() and c:IsAbleToHand()
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control a "Plunder Patroll" monster: Draw cards equal to the number of Equip Cards you control +1, then shuffle cards from your hand into the Deck equal to the number of Equip Cards you control (if any). You can only use this effect of "Plunder Patroll Parrrty" once per turn. If you Special Summon a "Plunder Patroll" monster(s) from the Extra Deck, while this card is in your GY: You can equip this card to that Special Summoned monster as an Equip Card with this effect. ● The equipped monster gains 500 ATK. You can only use this effect of "Plunder Patroll Parrrty" once per Duel. * The above text is unofficial and describes the card's functionality in the OCG.
|
--海造賊-祝宴
--Plunder Patroll Parrrty
--Scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Draw, then shuffle card(s) from hand to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--Equip this card to 1 of your "Plunder Patroll" monsters from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1},EFFECT_COUNT_CODE_DUEL)
e2:SetTarget(s.eqptg)
e2:SetOperation(s.eqpop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PLUNDER_PATROLL}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_PLUNDER_PATROLL),tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return Duel.IsPlayerCanDraw(tp,ct+1) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,ct,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),p,LOCATION_ONFIELD,0,nil)
if Duel.Draw(p,ct+1,REASON_EFFECT)>0 and ct>0 then
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(p,aux.TRUE,p,LOCATION_HAND,0,ct,ct,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(p)
end
end
function s.eqptgfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_PLUNDER_PATROLL) and c:IsSummonLocation(LOCATION_EXTRA) and c:IsLocation(LOCATION_MZONE) and c:IsSummonPlayer(tp)
end
function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg and eg:IsExists(s.eqptgfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.eqpop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not eg then return end
local tc=eg:FilterSelect(tp,s.eqptgfilter,1,1,nil,tp):GetFirst()
if tc then
s.equipop(tc,e,tp,e:GetHandler())
end
end
function s.equipop(c,e,tp,tc)
if not c:EquipByEffectAndLimitRegister(e,tp,tc,nil,true) then return end
--Gains 500 ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2)
end
function s.eqlimit(e,c)
return c:GetControler()==e:GetHandlerPlayer()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control an "Evil Eye" monster: Target 1 Spell/Trap your opponent controls; destroy it, and if you do, and "Evil Eye of Selene" is in your Spell & Trap Zone, banish that destroyed card. You can only activate 1 "Evil Eye Confrontation" per turn.
|
--惨禍の呪眼
--Evil Eye Confrontation
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.descond)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
s.listed_series={SET_EVIL_EYE}
s.listed_names={CARD_EVIL_EYE_SELENE}
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_EVIL_EYE)
end
function s.descond(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
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:IsControler(1-tp) and chkc:IsSpellTrap() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local dest
if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_EVIL_EYE_SELENE),tp,LOCATION_SZONE,0,1,nil) then
dest=LOCATION_REMOVED
end
Duel.Destroy(tc,REASON_EFFECT,dest)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is sent to the Graveyard as a Synchro Material Monster, inflict 2000 damage to the player that Synchro Summoned, and the Synchro Monster that used this card as a Synchro Material Monster gains 2000 ATK until the End Phase.
|
--バイス・バーサーカー
--Vice Berserker
local s,id=GetID()
function s.initial_effect(c)
--damage & atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(s.damcon)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rc=e:GetHandler():GetReasonCard()
Duel.SetTargetPlayer(rc:GetControler())
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rc:GetControler(),2000)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local rc=e:GetHandler():GetReasonCard()
if rc:IsFaceup() and rc:IsOnField() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(2000)
rc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can discard this card; add 1 "Bonding" Spell/Trap from your Deck to your hand. If this card is Normal or Special Summoned: You can target 1 "Hydrogeddon", "Oxygeddon", or "Duoterion" in your GY; Special Summon it. You can only use each effect of "Duoterion" once per turn.
|
--デューテリオン
--Duoterion
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.target)
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:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
s.listed_series={SET_BONDING}
function s.filter(c)
return c:IsSetCard(SET_BONDING) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.spfilter(c,e,tp)
return c:IsCode(22587018,58071123,id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During your Main Phase, you can Normal Summon 1 "Qli" monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.) Normal Summons of "Qli" monsters cannot be negated.
|
--機殻の要塞
--Laser Qlip
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)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_QLI))
c:RegisterEffect(e2)
--cannot disable summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_QLI))
c:RegisterEffect(e3)
end
s.listed_series={SET_QLI}
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Tribute 1 monster; excavate cards from the top of your Deck until you excavate a monster that can be Normal Summoned/Set. Special Summon it, also send the other excavated cards to the GY.
|
--モンスターゲート
--Monster Gate
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,tp) end
local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,tp)
Duel.Release(g,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0) and Duel.IsPlayerCanSpecialSummon(tp)
and Duel.IsExistingMatchingCard(Card.IsSummonableCard,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDiscardDeck(tp,1)
and not Duel.IsPlayerAffectedByEffect(tp,CARD_EHERO_BLAZEMAN) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummon(tp) or not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local g=Duel.GetMatchingGroup(Card.IsSummonableCard,tp,LOCATION_DECK,0,nil)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local seq=-1
local tc=g:GetFirst()
local spcard=nil
for tc in aux.Next(g) do
if tc:GetSequence()>seq then
seq=tc:GetSequence()
spcard=tc
end
end
if seq==-1 then
Duel.ConfirmDecktop(tp,dcount)
Duel.ShuffleDeck(tp)
return
end
Duel.ConfirmDecktop(tp,dcount-seq)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and spcard:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.DisableShuffleCheck()
if dcount-seq==1 then Duel.SpecialSummon(spcard,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(spcard,0,tp,tp,false,false,POS_FACEUP)
Duel.DiscardDeck(tp,dcount-seq-1,REASON_EFFECT)
Duel.SpecialSummonComplete()
end
else
Duel.DiscardDeck(tp,dcount-seq,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
3 Level 12 monsters If this card has a "Raidraptor" Xyz Monster as Xyz Material, it is unaffected by other cards' effects. Once per turn: You can detach 1 material from this card; return all your banished "Raidraptor" monsters to your GY. Up to twice per turn, when this attacking card destroys a monster by battle: You can banish 1 "Raidraptor" Xyz Monster from your GY; this card can attack again in a row.
|
--RR-ファイナル・フォートレス・ファルコン
--Raidraptor - Final Fortress Falcon
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,12,3)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.imcon)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(Cost.DetachFromSelf(1))
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
--chain attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCountLimit(2)
e3:SetCondition(s.atcon)
e3:SetCost(s.atcost)
e3:SetOperation(s.atop)
c:RegisterEffect(e3)
end
s.listed_series={SET_RAIDRAPTOR}
function s.imfilter(c)
return c:IsSetCard(SET_RAIDRAPTOR) and c:IsType(TYPE_XYZ)
end
function s.imcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(s.imfilter,1,nil)
end
function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_RAIDRAPTOR) and c:IsMonster()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,1,nil) end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_REMOVED,0,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT|REASON_RETURN)
end
end
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and c:CanChainAttack(0)
end
function s.atfilter(c)
return c:IsSetCard(SET_RAIDRAPTOR) and c:IsType(TYPE_XYZ) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
end
function s.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.atfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.atfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can only activate this card when you have no cards in your hand. Roll a six-sided die 3 times, and inflict damage to your opponent's Life Points equal to the total result of the die rolls x 100 points.
|
--ファイアーダーツ
--Fire Darts
local s,id=GetID()
function s.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DICE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.damcon)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
end
s.roll_dice=true
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local d1,d2,d3=Duel.TossDice(tp,3)
Duel.Damage(p,(d1+d2+d3)*100,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: If it is the Main Phase: Apply these effects in sequence. ● This turn, you cannot activate the effects of monsters Special Summoned from your hand. ● Give control of this card to your opponent. During your Main Phase: You can Special Summon this card from your hand to your opponent's field in face-down Defense Position, or if you control a "Mimighoul" monster, you can Special Summon this card face-up on your field. You can only use each effect of "Mimighoul Fairy" once per turn.
|
--ミミグル・フェアリー
--Mimighoul Fairy
--scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--FLIP: Apply these effects in sequence
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
e1:SetCountLimit(1,id)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
--Special Summon this card to your opponent's field in face-down Defense Position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.selfsptg)
e2:SetOperation(s.selfspop)
c:RegisterEffect(e2)
end
s.listed_series={SET_MIMIGHOUL}
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
if c:IsAbleToChangeControler() then
Duel.SetOperationInfo(0,CATEGORY_CONTROL,c,1,tp,0)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
--This turn, you cannot activate the effects of monsters Special Summoned from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--Give control of this card to your opponent
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
end
function s.aclimit(e,re,tp)
local rc=re:GetHandler()
return re:IsMonsterEffect() and rc:IsOnField() and rc:IsSpecialSummoned()
and rc:IsSummonLocation(LOCATION_HAND) and rc:IsPreviousControler(tp)
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp))
or (Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MIMIGHOUL),tp,LOCATION_MZONE,0,1,nil)
and 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 not c:IsRelateToEffect(e) then return end
local b1=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp)
local b2=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MIMIGHOUL),tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=nil
if b1 and b2 then
op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,3)},
{b2,aux.Stringid(id,4)})
else
op=(b1 and 1) or (b2 and 2) or 1
end
if op==1 then
if Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)==0 then return end
Duel.ConfirmCards(tp,c)
elseif op==2 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is face-up on the field, you can Normal Summon it to have it become an Effect Monster with this effect. ● When this card destroys an opponent's monster by battle and sends it to the Graveyard: You can add 1 "Gem-Knight" card from your Deck to your hand.
|
--ジェムナイト・サニクス
--Gem-Knight Sardonyx
local s,id=GetID()
function s.initial_effect(c)
Gemini.AddProcedure(c)
--Search 1 "Gem-Knight" card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
s.listed_series={SET_GEM_KNIGHT}
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
if not Gemini.EffectStatusCondition(e) then return false end
local tc=eg:GetFirst()
return #eg==1 and tc:GetReasonCard()==e:GetHandler()
and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
end
function s.filter(c)
return c:IsSetCard(SET_GEM_KNIGHT) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 monsters, including an Insect, Plant, or Reptile monster You can target 1 "Ragnaraika" monster in your GY; Special Summon it in Defense Position. If this card is in your GY: You can target 1 Insect, Plant, or Reptile monster you control; place it on the bottom of the Deck, and if you do, Special Summon this card. You can only use each effect of "Ragnaraika Skeletal Soldier" once per turn, also you cannot Special Summon during the turn you activate either of this card's effects, except Insect, Plant, or Reptile monsters.
|
--蕾禍ノ武者髑髏
--Ragnaraika Skeletal Soldier
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Link Summon procedure
Link.AddProcedure(c,nil,2,2,s.lcheck)
--Special Summon 1 "Ragnaraika" monster from your GY in Defense Position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.effcost)
e1:SetTarget(s.gysptg)
e1:SetOperation(s.gyspop)
c:RegisterEffect(e1)
--Place 1 Insect, Plant, or Reptile monster you control on the bottom of the Deck and Special Summon this card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCost(s.effcost)
e2:SetTarget(s.selfsptg)
e2:SetOperation(s.selfspop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) end)
end
s.listed_series={SET_RAGNARAIKA}
function s.lcheck(g,lc,sumtype,tp)
return g:IsExists(Card.IsRace,1,nil,RACE_INSECT|RACE_PLANT|RACE_REPTILE,lc,sumtype,tp)
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
--Cannot Special Summon monsters, except Insect, Plant, and Reptile 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_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(_,c) return not c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.gyspfilter(c,e,tp)
return c:IsSetCard(SET_RAGNARAIKA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.gyspfilter(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_DEFENSE)
end
end
function s.tdfilter(c,tp)
return c:IsRace(RACE_INSECT|RACE_PLANT|RACE_REPTILE) and c:IsFaceup() and c:IsAbleToDeck() and Duel.GetMZoneCount(tp,c)>0
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tdfilter(chkc,tp) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Special Summon this card (from your hand) by detaching 2 materials from monster(s) you control. When Summoned this way: You can target 2 Level 4 Fish monsters in your GY; Special Summon those targets in Defense Position. Their effects are negated, they cannot attack or change their battle positions, and cannot be used as material for an Xyz Summon, except for the Xyz Summon of a WATER monster.
|
--エクシーズ・リモーラ
--Xyz Remora
local s,id=GetID()
function s.initial_effect(c)
--Special summon itself from hand
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)
e1:SetValue(1)
c:RegisterEffect(e1)
--If summoned with above effect, special summon 2 level 4 fish monsters from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.CheckRemoveOverlayCard(c:GetControler(),1,0,2,REASON_COST)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveOverlayCard(tp,1,0,2,2,REASON_COST)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_FISH) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(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.spfilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<#g or (#g>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then return end
local c=e:GetHandler()
local tc=g:GetFirst()
for tc in aux.Next(g) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
--Cannot attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(3206)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
--Negate their effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e3)
--Cannot change their battle positions
local e4=Effect.CreateEffect(c)
e4:SetDescription(3313)
e4:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e4:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e4)
--Cannot be used as Xyz material, except for a WATER monster
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e5:SetValue(s.xyzlimit)
e5:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e5)
end
Duel.SpecialSummonComplete()
end
function s.xyzlimit(e,c)
if not c then return false end
return not c:IsAttribute(ATTRIBUTE_WATER)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control an Insect monster: Special Summon 2 "Worm Tokens" (Insect/EARTH/Level 1/ATK 0/DEF 0). You cannot Normal or Special Summon any Level 3 or 4 monsters the turn you activate this card.
|
--ワーム・ベイト
--Worm Bait
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
s.listed_names={43140792}
function s.counterfilter(c)
return not c:IsLevel(3) and not c:IsLevel(4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_INSECT),tp,LOCATION_MZONE,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.sumlimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH)
e3:SetDescription(aux.Stringid(id,1))
e3:SetReset(RESET_PHASE|PHASE_END)
e3:SetTargetRange(1,0)
Duel.RegisterEffect(e3,tp)
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
local lv=c:GetLevel()
return lv==3 or lv==4
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
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_WORM,TYPES_TOKEN,0,0,1,RACE_INSECT,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 not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_WORM,TYPES_TOKEN,0,0,1,RACE_INSECT,ATTRIBUTE_EARTH) then
for i=1,2 do
local token=Duel.CreateToken(tp,id+1)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Eldlich the Golden Lord" + 1 Zombie monster Must be either Fusion Summoned, or Special Summoned (from your Extra Deck) by Tributing 1 LIGHT Zombie monster, while you have "Eldlich the Golden Lord" in your field or GY. You can only Special Summon "Fallen Angel of the Golden Land" once per turn this way, no matter which method you use. If this card is sent from the field to the GY: You can Special Summon 1 "Eldlich" monster from your Deck, Extra Deck, or GY. You can only use this effect of "Fallen Angel of the Golden Land" once per turn.
|
--黄金郷のアンヘルカイド
--Fallen Angel of the Golden Land
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Fusion Materials: 1 "Eldlich the Golden Lord" + 1 Zombie monster
Fusion.AddProcMix(c,true,true,CARD_GOLDEN_LORD,aux.FilterBoolFunctionEx(Card.IsRace,RACE_ZOMBIE))
c:AddMustBeFusionSummoned()
--You can only Fusion Summon or Special Summon by its alternate procedure "Angelcaido of the Golden Land" once per turn
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(s.regcon)
e0:SetOperation(s.regop)
c:RegisterEffect(e0)
--You can Special Summon this card by Tributing 1 LIGHT Zombie monster while you have "Eldlich the Golden Lord" in your field or GY
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.selfspcon)
e1:SetTarget(s.selfsptg)
e1:SetOperation(s.selfspop)
e1:SetValue(1)
c:RegisterEffect(e1)
--Special Summon 1 "Eldlich" monster from your Deck, Extra Deck, or GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_names={CARD_GOLDEN_LORD,id}
s.material_setcode={SET_ELDLICH}
function s.regcon(e)
local c=e:GetHandler()
return c:IsFusionSummoned() or c:IsSummonType(SUMMON_TYPE_SPECIAL+1)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
--Prevent another Fusion Summon or Special Summon by its alternate procedure of "Angelcaido of the Golden Land" that turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,sump,sumtype) return c:IsCode(id) and (sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION or sumtype&SUMMON_TYPE_SPECIAL+1==SUMMON_TYPE_SPECIAL+1) end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.selfspcostfilter(c,tp,sc)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_ZOMBIE) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
end
function s.selfspcon(e,c)
if not c then return true end
if c:IsFaceup() then return false end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_GOLDEN_LORD),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil)
and Duel.CheckReleaseGroup(tp,s.selfspcostfilter,1,false,1,true,c,tp,nil,nil,nil,tp,c)
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.SelectReleaseGroup(tp,s.selfspcostfilter,1,1,false,true,true,c,tp,nil,false,nil,tp,c)
if not g then return false end
g:KeepAlive()
e:SetLabelObject(g)
return true
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.Release(g,REASON_COST|REASON_MATERIAL)
g:DeleteGroup()
end
function s.spfilter(c,e,tp,ft)
if not (c:IsSetCard(SET_ELDLICH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
else
return ft>0
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA|LOCATION_GRAVE,0,1,nil,e,tp,ft) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_EXTRA|LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK|LOCATION_EXTRA|LOCATION_GRAVE,0,1,1,nil,e,tp,ft)
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:
|
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) while you control a "Photon" or "Galaxy" monster. Cannot attack the turn it is Special Summoned. You can only Special Summon "Photon Vanisher(s)" once per turn. If this card is Special Summoned: You can add 1 "Galaxy-Eyes Photon Dragon" from your Deck to your hand. An Xyz Monster that was Summoned using this card on the field as material gains this effect. ● Banish any monster destroyed by battle with this card.
|
--フォトン・バニッシャー
--Photon Vanisher
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
c:SetSPSummonOnce(id)
--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)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCost(s.cost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(s.atklimit)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCondition(s.efcon)
e4:SetOperation(s.efop)
c:RegisterEffect(e4)
end
s.listed_series={SET_PHOTON,SET_GALAXY}
s.listed_names={CARD_GALAXYEYES_P_DRAGON}
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard({SET_PHOTON,SET_GALAXY}) and c:IsMonster()
end
function s.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(s.cfilter,c:GetControler(),LOCATION_MZONE,0,nil)
local ct=#g
return ct>0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.thfilter1(c)
return c:IsCode(CARD_GALAXYEYES_P_DRAGON) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter1,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.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function s.efcon(e,tp,eg,ep,ev,re,r,rp)
return (r&REASON_XYZ)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
The equipped monster gains 200 ATK for each Xyz Material on the field. Once per turn: You can activate the following effect, based on the equipped monster's card type; ● Xyz: Detach 2 materials from a monster(s) you control; Set 1 "Xyz" Spell/Trap from your Deck. ● Other: Special Summon 1 monster with the same Level as the equipped monster from your hand in Defense Position, but negate its effects. You can only activate 1 "Xyz Lay" per turn
|
--Japanese name
--Xyz Lay
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
local e0=aux.AddEquipProcedure(c)
e0:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
--The equipped monster gains 200 ATK for each Xyz Material attached to a monster on the field
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(function(e) return 200*Duel.GetOverlayCount(0,1,1) end)
c:RegisterEffect(e1)
--Activate the following effect, based on the equipped monster's card type
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end)
e2:SetCost(s.effcost)
e2:SetTarget(s.efftg)
e2:SetOperation(s.effop)
c:RegisterEffect(e2)
end
s.listed_series={SET_XYZ}
function s.thcfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsMonster() and c:IsDiscardable()
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
if chk==0 then return not ec:IsType(TYPE_XYZ) or Duel.CheckRemoveOverlayCard(tp,1,0,2,REASON_COST) end
if ec:IsType(TYPE_XYZ) then
Duel.RemoveOverlayCard(tp,1,0,2,2,REASON_COST)
end
end
function s.setfilter(c)
return c:IsSetCard(SET_XYZ) and c:IsSpellTrap() and c:IsSSetable()
end
function s.spfilter(c,e,tp,lv)
return c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
local b1=ec:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
local b2=not ec:IsType(TYPE_XYZ) and ec:HasLevel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,ec:GetLevel())
if chk==0 then return b1 or b2 end
if b1 then
e:SetLabel(1)
e:SetCategory(0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
elseif b2 then
e:SetLabel(2)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
--Set 1 "Xyz" Spell/Trap from your Deck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SSet(tp,g)
end
elseif op==2 then
--Special Summon 1 monster with the same Level as the equipped monster from your hand in Defense Position
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,c:GetEquipTarget():GetLevel()):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
--Negate its effects
sc:NegateEffects(c)
end
Duel.SpecialSummonComplete()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a monster declares an attack: You can negate the attack, and if you do, Special Summon 1 Level 4 or lower WATER monster from your hand, except "Glacial Beast Blizzard Wolf". At the start of your opponent's Battle Phase, if this card is in your GY and you control no monsters: You can Special Summon this card in Attack Position, but banish it when it leaves the field. You can only use each effect of "Glacial Beast Blizzard Wolf" once per turn.
|
--極氷獣ブリザード・ウルフ
--Glacial Beast Blizzard Wolf
--Logical Nonsense
--Substitute ID
local s,id=GetID()
function s.initial_effect(c)
--Negate attack, special summon 1 level 4 or lower WATER monster from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.negtg)
e1:SetOperation(s.negop)
c:RegisterEffect(e1)
--At the start of opponent's battle phase, special summon this card from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE|PHASE_BATTLE_START)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
--Specifically lists itself
s.listed_names={id}
--Check for level 4 or lower WATER (except for this card's name)
function s.filter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
--Activation legality
function s.negtg(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
--Special summon 1 level 4 or lower WATER monster from hand
function s.negop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateAttack() or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Start of opponent's battle phase and player controls no monsters
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
--Activation legality
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
--Special summon this card in attack position, but banish it if it leaves the field
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_ATTACK)>0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(3300)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is activated: Banish 3 cards from the top of your Deck, face-down. This card's name becomes "Toon World" while in the Field Zone. Your opponent cannot target Toon monsters you control with card effects. If a Toon monster(s) you control would be destroyed by battle or card effect, you can banish 1 card from the top of your Deck, face-down, for each of those monster(s) instead.
|
--トゥーン・キングダム
--Toon Kingdom
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--change code
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE)
e2:SetValue(15259703)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TOON))
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_FZONE)
e4:SetTarget(s.reptg)
e4:SetValue(s.repval)
c:RegisterEffect(e4)
end
s.listed_names={15259703}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
if ct>3 then ct=3 end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsType(TYPE_TOON) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=eg:FilterCount(s.repfilter,nil,tp)
local g=Duel.GetDecktopGroup(tp,ct)
if chk==0 then return ct>0 and g:IsExists(Card.IsAbleToRemove,ct,nil,tp,POS_FACEDOWN) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
return true
else return false end
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
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 2300. If this card attacks, it is changed to Defense Position at the end of the Battle Phase. This card's battle position cannot be changed until the end of your next turn, except with a card effect.
|
--竜影魚レイ・ブロント
--Phantom Dragonray Bronto
local s,id=GetID()
function s.initial_effect(c)
Gemini.AddProcedure(c)
--Original ATK becomes 2300
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(2300)
c:RegisterEffect(e1)
--Change to defense position after attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE|PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.poscon)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
end
function s.poscon(e,tp,eg,ep,ev,re,r,rp)
return Gemini.EffectStatusCondition(e) and e:GetHandler():GetAttackedCount()>0
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
--Cannot change position
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESETS_STANDARD_PHASE_END,3)
c:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1+ non-Tuner monsters Your opponent cannot target this card on the field with card effects. You can only use each of these effects of "Yazi, Evil of the Yang Zing" once per turn. ● You can target 1 "Yang Zing" monster you control and 1 card your opponent controls; destroy them. ● When this card you control is destroyed by battle or card effect and sent to your GY: You can Special Summon 1 Wyrm monster from your Deck in Defense Position.
|
--邪竜星-ガイザー
--Yazi, Evil of the Yang Zing
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
c:EnableReviveLimit()
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
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:SetCountLimit(1,id)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
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:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
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_YANG_ZING}
function s.desfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_YANG_ZING)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if #tg>0 then
Duel.Destroy(tg,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:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_WYRM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.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_DEFENSE)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] You can target 1 other "Symphonic Warrior" card you control; return both that card and this card to the hand. You can only use this effect of "Symphonic Warrior Guitariss" once per turn. ---------------------------------------- [ Monster Effect ] If "Symph Amplifire" is in your Field Zone: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can target 1 card in your Pendulum Zone; return it to the hand. You can only use each effect of "Symphonic Warrior Guitariss" once per turn.
|
--音響戦士ギタリス
--Symphonic Warrior Guitariss
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
Pendulum.AddProcedure(c)
--Return self and another "Symphonic Warrior" to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sthtg)
e1:SetOperation(s.sthop)
c:RegisterEffect(e1)
--Special Summon self
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function(_,tp) return Duel.IsEnvironment(75304793,tp,LOCATION_FZONE) end)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Return scale to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
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_SUMMON_SUCCESS)
e3:SetCountLimit(1,{id,2})
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
s.listed_series={SET_SYMPHONIC_WARRIOR}
s.listed_names={75304793}
function s.sthfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_SYMPHONIC_WARRIOR) and c:IsAbleToHand()
end
function s.sthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and chkc~=c and s.thfilter(chkc) end
if chk==0 then return c:IsAbleToHand() and Duel.IsExistingTarget(s.sthfilter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.sthfilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g+c,2,0,0)
end
function s.sthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(Group.FromCards(c,tc),nil,REASON_EFFECT)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you control a "Memento" monster: Target 1 card on the field; destroy it, then, if you control "Mementoal Tecuhtlica - Combined Creation", you can destroy 1 more card on the field. When an attack is declared involving your "Memento" monster and an opponent's monster: You can banish this card from your GY; all monsters your opponent currently controls lose 1000 ATK until the end of this turn. You can only use each effect of "Mementotlan Fracture Dance" once per turn.
|
--メメント・フラクチャー・ダンス
--Mementotlan Fracture Dance
--Scripted by Satellaa
local s,id=GetID()
function s.initial_effect(c)
--Destroy 1 card on the field
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e1:SetCountLimit(1,id)
e1:SetCondition(function(_,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MEMENTO),tp,LOCATION_MZONE,0,1,nil) end)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--Make all face-up monsters your opponent currently controls lose 1000 ATK
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.atkcon)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
s.listed_series={SET_MEMENTO}
s.listed_names={CARD_MEMENTOAL_TECUHTLICA}
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) and Duel.Destroy(tc,REASON_EFFECT)>0 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if #g>0 and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_MEMENTOAL_TECUHTLICA),tp,LOCATION_ONFIELD,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
if #dg==0 then return end
Duel.HintSelection(dg,true)
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local yc,oc=Duel.GetBattleMonster(tp)
return yc and oc and yc:IsFaceup() and yc:IsSetCard(SET_MEMENTO)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,1-tp,-1000)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,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:SetValue(-1000)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can pay 1500 LP; destroy all monsters on the field that were Special Summoned from the Extra Deck, also you can only attack with 1 monster this turn. You can only use each of the following effects of "Gizmek Okami, the Dreaded Deluge Dragon" once per turn. If 2 or more monsters Special Summoned from the Extra Deck are on the field: You can Special Summon this card from your hand. If this card in your possession is sent to your GY by your opponent: You can banish 1 monster from your opponent's GY, then gain LP equal to its ATK. * The above text is unofficial and describes the card's functionality in the OCG.
|
--機巧辰-高闇御津羽靇
--Gizmek Okami, the Dreaded Deluge Dragon
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(Cost.PayLP(1500))
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--Special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Banish and recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_RECOVER)
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,1})
e3:SetCondition(s.rmcon)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsSummonLocation,tp,LOCATION_MZONE,LOCATION_MZONE,nil,LOCATION_EXTRA)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSummonLocation,tp,LOCATION_MZONE,LOCATION_MZONE,nil,LOCATION_EXTRA)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetCondition(s.atkcon)
e1:SetTarget(s.atktg)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(s.checkop)
e2:SetReset(RESET_PHASE|PHASE_END)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
function s.atkcon(e)
return e:GetLabel()~=0
end
function s.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local fid=eg:GetFirst():GetFieldID()
e:GetLabelObject():SetLabel(fid)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsSummonLocation,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil,LOCATION_EXTRA)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():IsPreviousControler(tp)
end
function s.rmfilter(c)
return c:IsMonster() and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:GetAttack()>0 then
Duel.BreakEffect()
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Show up to 3 of the "Blue-Eyes White Dragon" in your hand, face-up Monster Zone, and/or GY, then destroy an equal number of cards your opponent controls. You can banish this card from your GY; Ritual Summon 1 Ritual Monster from your hand, by Tributing "Blue-Eyes White Dragon(s)" from your hand or field whose total Levels equal its Level. You can only use each effect of "Majesty of the White Dragons" once per turn.
|
--白き龍の威光
--Majesty of the White Dragons
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Show up to 3 "Blue-Eyes White Dragon(s)" from your hand, face-up Monster Zone, and/or GY, then destroy that many cards your opponent controls
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Ritual Summon 1 Ritual Monster from your hand, by Tributing "Blue-Eyes White Dragon(s)" from your hand or field
local e2=Ritual.CreateProc({handler=c,lvtype=RITPROC_EQUAL,matfilter=function(c) return c:IsCode(CARD_BLUEEYES_W_DRAGON) end,desc=aux.Stringid(id,1)})
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e2:SetCost(Cost.SelfBanish)
c:RegisterEffect(e2)
end
s.listed_names={CARD_BLUEEYES_W_DRAGON}
function s.showfilter(c)
return c:IsCode(CARD_BLUEEYES_W_DRAGON) and (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.showfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,1,nil)
and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
end
function s.rescon(sg,e,tp,mg)
return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>=#sg
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)==0 then return end
local showg=Duel.GetMatchingGroup(s.showfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,nil)
if #showg==0 then return end
local g=aux.SelectUnselectGroup(showg,e,tp,1,3,s.rescon,1,tp,HINTMSG_CONFIRM)
local ct=#g
if ct==0 then return end
local confirmg,hintg=g:Split(Card.IsLocation,nil,LOCATION_HAND)
if #confirmg>0 then Duel.ConfirmCards(1-tp,confirmg) Duel.ShuffleHand(tp) end
if #hintg>0 then Duel.HintSelection(hintg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local desg=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,ct,ct,nil)
if #desg>0 then
Duel.HintSelection(desg)
Duel.BreakEffect()
Duel.Destroy(desg,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When an attack is declared involving a Fusion Monster you control and an opponent's monster: That monster you control gains ATK equal to the ATK of the opponent's monster, until the end of the Damage Step. You can only activate 1 "Battle Fusion" per turn.
|
--決闘融合-バトル・フュージョン
--Battle Fusion
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
return at and ((a:IsControler(tp) and a:IsType(TYPE_FUSION))
or (at:IsControler(tp) and at:IsFaceup() and at:IsType(TYPE_FUSION)))
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
if a:IsControler(1-tp) then a,at=at,a end
if not a:IsRelateToBattle() or a:IsFacedown() or not at:IsRelateToBattle() or at:IsFacedown() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE)
e1:SetValue(at:GetAttack())
a:RegisterEffect(e1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" + "Blue-Eyes White Dragon" Your opponent cannot target or destroy this card with card effects. Once per turn: You can target 1 card your opponent controls; destroy it. If this card was Fusion Summoned using a monster whose original name is "Blue-Eyes Alternative White Dragon" as material, you can target up to 3 cards your opponent controls instead. This card cannot attack the turn this effect is activated.
|
--青眼の究極亜龍
--Blue-Eyes Alternative Ultimate Dragon
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Must be properly summoned before reviving
c:EnableReviveLimit()
--Fusion summon procedure
Fusion.AddProcMixN(c,true,true,CARD_BLUEEYES_W_DRAGON,3)
--Cannot be targeted by opponent's card effects
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--Cannot be destroyed by opponent's card effects
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(s.indval)
c:RegisterEffect(e2)
--Destroy up to 3 of opponent's cards
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(s.descost)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(s.valcheck)
c:RegisterEffect(e4)
end
s.material_setcode=SET_BLUE_EYES
s.listed_names={CARD_BLUEEYES_W_DRAGON,38517737}
function s.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
function s.valcheck(e,c)
if c:GetMaterial():IsExists(Card.IsOriginalCode,1,nil,38517737) then
c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~(RESET_TOFIELD|RESET_TEMP_REMOVE|RESET_LEAVE),EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
--Cannot attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3206)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local mc=1
if e:GetHandler():GetFlagEffect(id) ~= 0 then mc=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,mc,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Any battle damage a player takes is halved. If you control a LIGHT Beast monster or a Level 7 or 8 Dragon Synchro Monster: You can draw 1 card. You can only use this effect of "Fairy Tale Prologue: Journey's Dawn" once per turn. During your Standby Phase: You can send this card from the Field Zone to the GY; place 1 Field Spell from your hand or Deck face-up in your Field Zone, except "Fairy Tale Prologue: Journey's Dawn".
|
--Fairy Tale 序章 旅立ちの暁光
--Fairy Tale Prologue: Journey's Dawn
--scripted by pyrQ
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)
--Any battle damage a player takes is halved
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(1,1)
e1:SetValue(HALF_DAMAGE)
c:RegisterEffect(e1)
--Draw 1 card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
--Place 1 Field Spell from your hand or Deck face-up in your Field Zone, except "Fairy Tale Prologue: Journey's Dawn"
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
e3:SetCost(Cost.SelfToGrave)
e3:SetTarget(s.pltg)
e3:SetOperation(s.plop)
c:RegisterEffect(e3)
end
s.listed_names={id}
function s.drconfilter(c)
return ((c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST))
or (c:IsLevel(7,8) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)))
and c:IsFaceup()
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.drconfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function s.plfilter(c,tp)
return c:IsFieldSpell() and not c:IsForbidden() and c:CheckUniqueOnField(tp) and not c:IsCode(id)
end
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end
end
function s.plop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if not sc then return end
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(sc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can target 1 face-up monster your opponent controls; until the End Phase, this card's name becomes that monster's original name, also replace this effect with that monster's original effects (if any).
|
--N・ブラック・パンサー
--Neo-Spacian Dark Panther
local s,id=GetID()
function s.initial_effect(c)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsType(TYPE_TOKEN) then
local code=tc:GetOriginalCodeRule()
local cid=0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code, RESETS_STANDARD_PHASE_END, 1)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] When you Pendulum Summon a monster(s): You can target 1 card in either player's Pendulum Zone; return it to the hand. You can only use this effect of "Performapal Trampolynx" once per turn. ---------------------------------------- [ Monster Effect ] When this card is Normal Summoned: You can target 1 card in either player's Pendulum Zone; return it to the hand.
|
--EMトランポリンクス
--Performapal Trampolynx
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
Pendulum.AddProcedure(c)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop1)
c:RegisterEffect(e2)
--tohand
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:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop2)
c:RegisterEffect(e3)
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsPendulumSummoned()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.filter(c)
return c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_PZONE,LOCATION_PZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_PZONE,LOCATION_PZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.thop2(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 an opponent's monster declares an attack: Target the attacking monster; negate that attack, and if you do, gain LP equal to that target's ATK.
|
--ドレインシールド
--Draining Shield
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg and tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
local rec=tg:GetAttack()
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:CanAttack() then
if Duel.NegateAttack(tc) then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Tribute this card; Special Summon 1 Level 5 or higher "Ice Barrier" monster from your hand. If this card is in your GY, except the turn it was sent there: You can target 1 Level 3 or higher WATER monster you control; reduce its Level by exactly 2, and if you do, Special Summon this card, but banish it when it leaves the field. You can only use each effect of "Zuijin of the Ice Barrier" once per turn.
|
--アイスバリアのアテンダント
--Zuijin of the Ice Barrier
--LUA by Kohana Sonogami
local s,id=GetID()
function s.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.SelfTribute)
e1:SetTarget(s.sptg1)
e1:SetOperation(s.spop1)
c:RegisterEffect(e1)
--Special Summon 2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(aux.exccon)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
--Listed of Archetype
s.listed_series={SET_ICE_BARRIER}
--Check for "Ice Barrier" monster
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_ICE_BARRIER) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
--Select the Location/Target
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
--Activation
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Check for Level 3 or higher WATER
function s.spfilter2(c)
return c:IsFaceup() and c:IsLevelAbove(3) and c:IsAttribute(ATTRIBUTE_WATER)
end
--Check the Target
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.spfilter2(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.spfilter2,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.spfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND)
end
--Activation
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or tc:GetLevel()<3 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(-2)
tc:RegisterEffect(e1)
if not tc:IsImmuneToEffect(e1) and c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
--Banish it if it leaves the field
local e2=Effect.CreateEffect(c)
e2:SetDescription(3300)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT|RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Pay 2000 LP and reveal your entire hand; look at your opponent's hand and banish 1 card from their hand, until your opponent's next End Phase.
|
--紅蓮の指名者
--Appointer of the Red Lotus
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_TOHAND)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=0
and not Duel.IsExistingMatchingCard(Card.IsPublic,tp,LOCATION_HAND,0,1,nil) end
Duel.PayLPCost(tp,2000)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g0=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g0)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if Duel.IsTurnPlayer(1-tp) and Duel.IsPhase(PHASE_END) then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN)
end
e1:SetLabelObject(tc)
e1:SetCondition(s.retcon)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
end
Duel.ShuffleHand(1-tp)
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(id)==0 then
e:Reset()
return false
else
return Duel.IsTurnPlayer(1-tp) and Duel.GetTurnCount()~=e:GetLabel()
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card's name becomes "PSY-Frame Driver" while it is in the hand or Graveyard. If a "PSY-Frame" card(s) you control would be destroyed by battle or card effect, you can discard this card instead. If a "PSY-Frame" Tuner is Special Summoned to your field, while this card is in your Graveyard (except during the Damage Step): You can Special Summon this card, but banish it when it leaves the field. You can only use this effect of "PSY-Frame Multi-Threader" once per turn.
|
--PSYフレーム・マルチスレッダー
--PSY-Frame Multi-Threader
local s,id=GetID()
function s.initial_effect(c)
--Name becomes "PSY-Frame Driver" while in hand or GY
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
e1:SetValue(CARD_PSYFRAME_DRIVER)
c:RegisterEffect(e1)
--Substitute destruction for a "PSY-Frame" card(s)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
--Special summon itself from 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)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_PSY_FRAME}
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_PSY_FRAME) and c:IsOnField() and c:IsControler(tp)
and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT|REASON_BATTLE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT+REASON_DISCARD+REASON_REPLACE)
end
function s.cfilter(c,tp)
return c:IsSetCard(SET_PSY_FRAME) and c:IsType(TYPE_TUNER) and c:IsControler(tp)
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 c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
--Banish it if it leaves the field
local e1=Effect.CreateEffect(c)
e1:SetDescription(3300)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot attack the turn it is Normal Summoned or flipped face-up. If this card is sent to the Graveyard as a Fusion Material for a Fusion Summon: You can activate this effect; for the rest of this turn, "Melodious" monsters you control cannot be destroyed by battle or card effects.
|
--幻奏の音女オペラ
--Opera the Melodious Diva
local s,id=GetID()
function s.initial_effect(c)
--cannot attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(s.atklimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCondition(s.indcon)
e3:SetOperation(s.indop)
c:RegisterEffect(e3)
end
s.listed_series={SET_MELODIOUS}
function s.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function s.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_FUSION and e:GetHandler():IsLocation(LOCATION_GRAVE)
end
function s.indop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_MELODIOUS))
e1:SetValue(1)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent activates a monster effect, while you control a "Therion" monster: You can activate 1 of these effects; ● Negate that effect. ● Banish that monster. If you have "Endless Engine Argyro System" in your GY at activation, you can activate both effects (at resolution, negate, also, after that, banish). You can only activate 1 "Therion Cross" per turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--セリオンズ・クロス
--Therion Cross
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={CARD_ARGYRO_SYSTEM}
s.listed_series={SET_THERION}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsMonsterEffect()
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_THERION),tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
local b1=Duel.IsChainDisablable(ev) and not rc:IsDisabled()
local b2=rc:IsAbleToRemove() and rc:IsRelateToEffect(re) and not rc:IsLocation(LOCATION_REMOVED)
local b3=b1 and b2 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,CARD_ARGYRO_SYSTEM)
if chk==0 then return b1 or b2 or b3 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,0)},
{b2,aux.Stringid(id,1)},
{b3,aux.Stringid(id,2)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_DISABLE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
elseif op==2 then
Duel.SetTargetCard(rc)
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,1-tp,rc:GetLocation())
elseif op==3 then
Duel.SetTargetCard(rc)
e:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,1-tp,rc:GetLocation())
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
local rc=re:GetHandler()
--Negate that effect
if op==1 then
Duel.NegateEffect(ev)
--Banish that monster
elseif op==2 then
if rc:IsRelateToEffect(e) then
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
end
--Activate both, in sequence
elseif op==3 then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can reveal this card in your hand; your opponent randomly chooses 1 card from your entire hand, then you discard the chosen card. Then, if the discarded card was not "Danger! Bigfoot!", Special Summon 1 "Danger! Bigfoot!" from your hand, and if you do, draw 1 card. If this card is discarded: You can target 1 face-up card your opponent controls; destroy it. You can only use this effect of "Danger! Bigfoot!" once per turn.
|
--未み界かい域いきのビッグフット
--Danger! Bigfoot!
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Discard 1 card, Special Summon itself and draw 1 card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Destroy 1 face-up card your opponent controls
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
s.listed_names={id}
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.spfilter(c,e,tp)
return 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 true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if #g<1 then return end
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD)
local tc=g:RandomSelect(1-tp,1)
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT|REASON_DISCARD)
if not Duel.IsPlayerCanSpecialSummon(tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not tc:GetFirst():IsCode(id) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #sc>0 and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_HAND and (r&REASON_DISCARD)~=0
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be destroyed by battle. If this card is in face-up Defense Position, destroy it. If this card is Normal Summoned: Place 1 Fog Counter on it for each "Cloudian" monster on the field. You can remove 2 Fog Counters from this card, then target 1 monster on the field; destroy that target.
|
--雲魔物-キロスタス
--Cloudian - Cirrostratus
local s,id=GetID()
function s.initial_effect(c)
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--selfdes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetCondition(s.sdcon)
c:RegisterEffect(e2)
--counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetOperation(s.addc)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(s.descost)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
s.listed_series={SET_CLOUDIAN}
s.counter_place_list={COUNTER_FOG}
function s.sdcon(e)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENSE)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_CLOUDIAN)
end
function s.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
e:GetHandler():AddCounter(COUNTER_NEED_ENABLE+COUNTER_FOG,ct)
end
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,COUNTER_FOG,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,COUNTER_FOG,2,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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:
|
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned: You can draw 1 card, or if "World of Spirits" is on the field, add 1 LIGHT monster (Beast, Plant, or Fairy) or 1 "Eternal Sunshine" from your Deck to your hand instead. You can only use this effect of "Ancient Fairy Life Dragon" once per turn. Your "Ancient Fairy Dragon" and monsters that mention it can attack while in face-up Defense Position (apply their DEF for damage calculation).
|
--エンシェント・フェアリー・ライフ・ドラゴン
--Ancient Fairy Life Dragon
--Scripted by Eerie Code
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)
--Draw 1 card, or add 1 LIGHT Beast, Plant, or Fairy monster, or 1 "Eternal Sunshine" from your Deck to your hand instead
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end)
e1:SetTarget(s.drthtg)
e1:SetOperation(s.drthop)
c:RegisterEffect(e1)
--Your "Ancient Fairy Dragon" and monsters that mention it can attack while in face-up Defense Position. If they do, apply their DEF for damage calculation
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c) return c:IsCode(CARD_ANCIENT_FAIRY_DRAGON) or c:ListsCode(CARD_ANCIENT_FAIRY_DRAGON) end)
e2:SetValue(1)
c:RegisterEffect(e2)
end
s.listed_names={5414777,28903523,CARD_ANCIENT_FAIRY_DRAGON} --"The World of Spirits", "Eternal Sunshine"
function s.thfilter(c)
return ((c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST|RACE_PLANT|RACE_FAIRY)) or c:IsCode(28903523)) and c:IsAbleToHand()
end
function s.drthtg(e,tp,eg,ep,ev,re,r,rp,chk)
local world_of_spirits_chk=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,5414777),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b1=not world_of_spirits_chk and Duel.IsPlayerCanDraw(tp,1)
local b2=world_of_spirits_chk and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
if b1 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.drthop(e,tp,eg,ep,ev,re,r,rp)
local world_of_spirits_chk=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,5414777),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
if not world_of_spirits_chk then
Duel.Draw(tp,1,REASON_EFFECT)
else
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:
|
Target 1 "Fusion" or "Polymerization" Normal or Quick-Play Spell in either player's GY; banish that Spell, then apply that Spell's effect when that card is activated. You can only activate 1 "Fusion Duplication" per turn.
|
--融合複製
--Fusion Duplication
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_FUSION}
function s.cpfilter(c)
return c:IsSetCard(SET_FUSION) and (c:IsNormalSpell() or c:IsQuickPlaySpell()) and c:IsAbleToRemove()
and c:CheckActivateEffect(true,true,false)~=nil
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject():GetFirst():CheckActivateEffect(true,true,false)
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(s.cpfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectTarget(tp,s.cpfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil):GetFirst()
e:SetLabelObject(tc)
local te=tc:CheckActivateEffect(true,true,false)
e:SetProperty(EFFECT_FLAG_CARD_TARGET|te:GetProperty())
local tg=te:GetTarget()
if tg then
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
Duel.ClearOperationInfo(0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) or Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end
local te=tc:CheckActivateEffect(true,true,false)
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is destroyed by battle and sent to the Graveyard: Your opponent can discard 1 card to negate this card's effect, otherwise destroy the monster that destroyed this card.
|
--ジュラック・ガリム
--Jurrac Gallim
local s,id=GetID()
function s.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetReasonCard()
if tc:IsRelateToBattle() and not Duel.IsExistingMatchingCard(Card.IsDiscardable,1-tp,LOCATION_HAND,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetReasonCard()
if not tc:IsRelateToBattle() then return end
if Duel.IsExistingMatchingCard(Card.IsDiscardable,1-tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
Duel.DiscardHand(1-tp,Card.IsDiscardable,1,1,REASON_EFFECT|REASON_DISCARD,nil)
else Duel.Destroy(tc,REASON_EFFECT) end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If your "Memento" monster battles, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step. If a monster(s) you control is destroyed by battle or card effect: You can target 1 of those monsters; Special Summon 1 "Memento" monster with a lower Level from your hand or GY. You can only use this effect of "Mementomictlan" once per turn. Once per turn, during your End Phase: You can target 1 "Memento" Spell/Trap in your GY; Set it.
|
--冥骸府-メメントラン
--Mementomictlan
--Scripted by Satellaa
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)
--Prevent Spell/Trap activations during battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(0,1)
e1:SetValue(function(_,re) return re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
e1:SetCondition(s.actcon)
c:RegisterEffect(e1)
--Special Summon 1 "Memento" monster from your hand or GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Set 1 "Memento" Spell/Trap from your GY to your field
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end
s.listed_series={SET_MEMENTO}
function s.actcon(e)
local bc=Duel.GetBattleMonster(e:GetHandlerPlayer())
return bc and bc:IsFaceup() and bc:IsSetCard(SET_MEMENTO)
end
function s.tcfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
and c:HasLevel() and c:IsCanBeEffectTarget(e) and not c:IsType(TYPE_TOKEN)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel())
end
function s.spfilter(c,e,tp,lv)
return c:IsSetCard(SET_MEMENTO) and c:IsLevelBelow(lv-1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and s.tcfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(s.tcfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=eg:FilterSelect(tp,s.tcfilter,1,1,nil,e,tp):GetFirst()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp,tc:GetLevel())
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.setfilter(c)
return c:IsSetCard(SET_MEMENTO) and c:IsSpellTrap() and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Negate the Normal Summon or Flip Summon of a monster and return it to its owner's hand.
|
--キックバック
--Forced Back
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain(true)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.NegateSummon(eg:GetFirst())
Duel.SendtoHand(eg,nil,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target cards in your opponent's GY, up to the number of "Valkyrie" monsters you control; banish them. If this Set card in its owner's control has left the field because of an opponent's effect, and is now in the GY or banished: You can draw cards equal to the number of "Valkyrie" monsters you control +1.
|
--フライアのリンゴ
--Apple of Enlightenment
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
s.listed_series={SET_VALKYRIE}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsAbleToRemove() and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsPlayerCanDraw(tp,ct+1) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,nil)
Duel.Draw(p,ct+1,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can target 1 Set card in your opponent's Spell & Trap Zone; this card gains this effect. ● The targeted card cannot be activated. * The above text is unofficial and describes the card's functionality in the OCG.
|
--エレクトロ軍曹
--Sergeant Electro
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter(c,rc)
return c:IsFacedown() and c:GetSequence()~=5 and not rc:IsHasCardTarget(c)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and s.filter(chkc,e:GetHandler()) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_SZONE,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_SZONE,1,1,nil,e:GetHandler())
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 and tc:IsFacedown() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetCondition(s.rcon)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
function s.rcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is sent from the Deck to the GY: Send as many cards you control as possible to the GY, and if you do, Special Summon this card, then send cards your opponent controls to the GY up to the number sent to the GY by this effect. Neither player can activate monster effects in response to this effect's activation. If this card is sent to the GY, except from the Deck: You can send 1 card from your hand to the GY; send 1 card on the field to the GY. You can only use 1 "Wandering Titan of Tartarus" effect per turn, and only once that turn.
|
--地下牢の徊神
--Wandering Titan of Tartarus
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Send as many cards you control as possible to the GY, and if you do, Special Summon this card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_DECK) end)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Send 1 card on the field to the GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCondition(function(e) return not e:GetHandler():IsPreviousLocation(LOCATION_DECK) end)
e2:SetCost(s.tgcost)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,tp,0)
Duel.SetChainLimit(function(te) return not te:IsMonsterEffect() end)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local your_fg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
if #your_fg==0 or Duel.SendtoGrave(your_fg,REASON_EFFECT)==0 then return end
local c=e:GetHandler()
local ct=your_fg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct>0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local opp_fg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if #opp_fg==0 then return end
if #opp_fg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
opp_fg=opp_fg:Select(tp,1,math.min(ct,#opp_fg),nil)
end
Duel.HintSelection(opp_fg)
Duel.BreakEffect()
Duel.SendtoGrave(opp_fg,REASON_EFFECT)
end
end
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1 or more non-Tuner monsters Once per turn, when an Equip Card is equipped to this card: Inflict 800 damage to your opponent. Once per turn: You can target 1 Equip Card equipped to this card; send it to the Graveyard. When an Equip Card equipped to this card is sent to the Graveyard (except during the Damage Step): You can target 1 face-up monster your opponent controls; destroy that target.
|
--セブン・ソード・ウォリアー
--Seven Swords Warrior
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCountLimit(1)
e1:SetCode(EVENT_EQUIP)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetEquipTarget()==e:GetHandler() end
if chk==0 then return e:GetHandler():GetEquipCount()~=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=e:GetHandler():GetEquipGroup():Select(tp,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function s.cfilter(c,ec,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:GetEquipTarget()==ec
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,e:GetHandler(),tp)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Uria, Lord of Searing Flames" + "Hamon, Lord of Striking Thunder" + "Raviel, Lord of Phantasms" Must first be Special Summoned (from your Extra Deck) by banishing the above cards you control. (You do not use "Polymerization".) Cannot be destroyed by battle. Gains 10,000 ATK during your turn only.
|
--混沌幻魔アーミタイル
--Armityle the Chaos Phantasm
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,6007213,32491822,69890967)
Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit)
--Cannot be destroyed by battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--Increase ATK
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.atkcon)
e2:SetValue(10000)
c:RegisterEffect(e2)
end
s.listed_names={6007213,32491822,69890967}
function s.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function s.contactfil(tp)
return Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD,0,nil)
end
function s.contactop(g)
Duel.Remove(g,POS_FACEUP,REASON_COST|REASON_MATERIAL)
end
function s.atkcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Special Summoned. During the End Phase of the turn this card is Normal Summoned or flipped face-up: Return it to the hand. When this card is Normal Summoned or flipped face-up: You can reveal 1 Spirit monster from your hand, except "Rasetsu", then target 1 face-up Attack Position monster your opponent controls; return that target to the hand. You cannot Special Summon during the turn you activate this effect.
|
--羅刹
--Rasetsu
local s,id=GetID()
function s.initial_effect(c)
Spirit.AddProcedure(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--Cannot be Special Summoned
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--Return 1 face-up Attack Position monster to the hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCost(s.sretcost)
e2:SetTarget(s.srettg)
e2:SetOperation(s.sretop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3)
end
s.listed_names={id}
s.listed_card_types={TYPE_SPIRIT}
function s.cfilter(c)
return c:IsType(TYPE_SPIRIT) and not c:IsCode(id) and not c:IsPublic()
end
function s.sretcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
--Cannot Special Summon
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:SetReset(RESET_PHASE|PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function s.sretfilter(c)
return c:IsAttackPos() and c:IsAbleToHand()
end
function s.srettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.sretfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.sretfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.sretfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.sretop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and tc:IsAttackPos() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If a "Raidraptor" Xyz Monster was destroyed and sent to the Graveyard this turn while you controlled it: Target 1 "Raidraptor" Xyz Monster in your Graveyard; Special Summon it, then Special Summon from your Extra Deck, 1 "Raidraptor" monster that is 1 Rank higher than that monster, by using it as the Xyz Material. (This Special Summon is treated as an Xyz Summon.)
|
--RUM-ラプターズ・フォース
--Rank-Up-Magic Raptor's Force
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_DESTROY|TIMING_END_PHASE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
aux.GlobalCheck(s,function()
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end)
end
s.listed_series={SET_RAIDRAPTOR}
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
for tc in aux.Next(eg) do
if tc:IsSetCard(SET_RAIDRAPTOR) and tc:IsType(TYPE_XYZ) and tc:IsReason(REASON_DESTROY) then
if tc:IsPreviousControler(0) then p1=true else p2=true end
end
end
if p1 then Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,id,RESET_PHASE|PHASE_END,0,1) end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)~=0
end
function s.filter1(c,e,tp)
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and c:IsSetCard(SET_RAIDRAPTOR) and c:IsType(TYPE_XYZ) and (c:GetRank()>0 or c:IsStatus(STATUS_NO_LEVEL)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1,pg)
end
function s.filter2(c,e,tp,mc,rk,pg)
if c.rum_limit and not c.rum_limit(mc,e) then return false end
return c:IsType(TYPE_XYZ) and mc:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp)
and c:IsRank(rk) and c:IsSetCard(SET_RAIDRAPTOR) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and mc:IsCanBeXyzMaterial(c,tp) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,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.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>00
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ)
if not tc or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e)
or Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0
or #pg>1 or (#pg==1 and not pg:IsContains(tc)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,pg)
local sc=g:GetFirst()
if sc then
Duel.BreakEffect()
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,tc)
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1 or more non-Tuner monsters During each of your End Phases: Gain 600 LP for each Psychic-Type monster you currently control.
|
--マジカル・アンドロイド
--Magical Android
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
c:EnableReviveLimit()
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1)
e1:SetCondition(s.reccon)
e1:SetTarget(s.rectg)
e1:SetOperation(s.recop)
c:RegisterEffect(e1)
end
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),tp,LOCATION_MZONE,0,nil)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct*600)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*600)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),tp,LOCATION_MZONE,0,nil)
Duel.Recover(tp,ct*600,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 DARK Pendulum Monsters Must be either Fusion Summoned, or Special Summoned by Tributing the above cards you control (in which case you do not use "Polymerization"). Once per turn: You can target 1 other monster on the field or in the GY; until the End Phase, this card's name becomes that monster's original name, and replace this effect with that monster's original effects, also for the rest of this turn, if your monster attacks a Defense Position monster, inflict piercing battle damage to your opponent.
|
--覇王眷竜スターヴ・ヴェノム
--Supreme King Dragon Starving Venom
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Fusion materials: 2 DARK Pendulum monsters
Fusion.AddProcMixN(c,true,true,s.ffilter,2)
--Special Summon this card by tributing the above cards you control
Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit,nil,nil,nil,false)
--Copy the name and effect of another monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCost(s.copycost)
e1:SetTarget(s.copytg)
e1:SetOperation(s.copyop)
c:RegisterEffect(e1)
end
function s.ffilter(c,fc,sumtype,tp)
return c:IsAttribute(ATTRIBUTE_DARK,fc,sumtype,tp) and c:IsType(TYPE_PENDULUM,fc,sumtype,tp)
end
function s.contactfil(tp)
return Duel.GetReleaseGroup(tp)
end
function s.contactop(g)
Duel.Release(g,REASON_COST|REASON_MATERIAL)
end
function s.splimit(e,se,sp,st)
return (st&SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(41209827)==0 end
e:GetHandler():RegisterFlagEffect(41209827,RESETS_STANDARD_PHASE_END,0,1)
end
function s.copyfilter(c)
return c:IsMonster() and not c:IsType(TYPE_TOKEN) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.copyfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(s.copyfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.copyfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,1,c)
end
function s.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetOriginalCode()
--This card's name becomes the target's name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
if not tc:IsType(TYPE_TRAPMONSTER) then
c:CopyEffect(code,RESETS_STANDARD_PHASE_END,1)
end
end
--Inflict piercing battle damage to your opponent for the rest of the turn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PIERCE)
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:
|
Target 1 "Destiny HERO" monster you control; equip this card to that target. It gains 500 ATK. If it destroys an opponent's monster by battle and sends it to the GY: Inflict 500 damage to your opponent.
|
--D-チェーン
--D - Chain
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
s.listed_series={SET_DESTINY_HERO}
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_DESTINY_HERO)
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:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.damcon)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
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(500)
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:GetControler()==e:GetOwnerPlayer() and c:IsSetCard(SET_DESTINY_HERO)
end
function s.damfilter(c,rc)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.damfilter,1,nil,e:GetHandler():GetEquipTarget())
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If a Normal Monster(s) is sent to your GY (except during the Damage Step): You can Special Summon this card from your hand. If this card is in your GY: You can send 1 Dragon monster from your hand to the GY; add this card to your hand. You can only use each effect of "Guardragon Garmides" once per turn.
|
--守護竜ガルミデス
--Guardragon Garmides
--scripted by Logical Nonsense
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:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.tgfilter(c,tp)
return c:IsControler(tp) and c:IsType(TYPE_NORMAL)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.tgfilter,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
function s.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) by Tributing 1 Level 8 "Flower Cardian" monster, except "Flower Cardian Zebra Grass with Moon". If this card is Special Summoned: Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster. Otherwise, send it to the GY. Once per turn, when this card destroys an opponent's monster by battle: You can draw 1 card.
|
--花札衛-芒に月-
--Flower Cardian Zebra Grass with Moon
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Must first be Special Summoned (from your hand) by Tributing 1 Level 8 "Flower Cardian" monster, except "Flower Cardian Zebra Grass with Moon"
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_HAND)
e0:SetCondition(s.selfspcon)
e0:SetTarget(s.selfsptg)
e0:SetOperation(s.selfspop)
c:RegisterEffect(e0)
--Draw 1 card, and if you do, show it, then you can Special Summon it if it is a "Flower Cardian" monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.drsptg)
e1:SetOperation(s.drspop)
c:RegisterEffect(e1)
--Draw 1 card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCountLimit(1)
e2:SetCondition(aux.bdocon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
s.listed_series={SET_FLOWER_CARDIAN}
s.listed_names={id}
function s.selfspfilter(c)
return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsLevel(8) and not c:IsCode(id)
end
function s.selfspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,s.selfspfilter,1,false,1,true,c,tp,nil,false,nil)
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.SelectReleaseGroup(tp,s.selfspfilter,1,1,false,true,true,c,nil,nil,false,nil)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
end
return false
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
if not g then return end
Duel.Release(g,REASON_COST)
g:DeleteGroup()
end
function s.drsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function s.drspop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 then
local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,dc)
if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and dc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP)
end
else
Duel.BreakEffect()
Duel.SendtoGrave(dc,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
This card is used to Ritual Summon "Performance of Sword". You must also Tribute monsters from your hand or field whose total Levels equal 6 or more.
|
--踊りによる誘発
--Commencement Dance
local s,id=GetID()
function s.initial_effect(c)
Ritual.AddProcGreaterCode(c,6,nil,4849037)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can conduct 2 Normal Summons/Sets this turn, not just 1.
|
--二重召喚
--Double Summon
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SET_SUMMON_COUNT_LIMIT)}
for _,te in ipairs(ce) do
ct=math.max(ct,te:GetValue())
end
return ct<2
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(2)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card attacks a monster, after damage calculation: The ATK of that monster becomes 0, also it cannot change its battle position.
|
--レプティレス・ゴルゴーン
--Reptilianne Gorgon
local s,id=GetID()
function s.initial_effect(c)
--Attacked monster's ATK becomes 0, also cannot change its battle position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLED)
e1:SetCondition(s.condition)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if not d:IsRelateToBattle() then return end
--ATK becomes 0
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
d:RegisterEffect(e1)
--Cannot change its battle position
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(3313)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
d:RegisterEffect(e2)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.