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:
|
The first time this Special Summoned card would be destroyed by battle each turn, it is not destroyed. Once per turn, during your opponent's End Phase: You can target 1 Level 3 or lower "Performapal" monster in your Graveyard; send this card to the Graveyard, and if you do, add that monster to your hand. If a "Performapal" monster is sent from the hand to your Graveyard (except during the Damage Step), while this card is in your Graveyard: You can Special Summon this card. You can only use this effect of "Performapal Teeter Totter Hopper" once per turn.
|
--EMギッタンバッタ
--Performapal Teeter Totter Hopper
local s,id=GetID()
function s.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(1)
e1:SetValue(s.valcon)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_PERFORMAPAL}
function s.valcon(e,re,r,rp)
return (r&REASON_BATTLE)~=0 and e:GetHandler():IsSpecialSummoned()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
function s.thfilter(c)
return c:IsSetCard(SET_PERFORMAPAL) and c:IsLevelBelow(3) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return e:GetHandler():IsAbleToGrave()
and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
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()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.cfilter(c)
return c:IsMonster() and c:IsSetCard(SET_PERFORMAPAL) and c:IsPreviousLocation(LOCATION_HAND)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
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
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If a face-up Plant monster(s) you control is sent to the GY (except during the Damage Step): You can Special Summon this card from your hand. If a Plant monster is on the field and this card is in your GY: You can add this card to your hand. You can only use 1 "Rose Girl" effect per turn, and only once that turn.
|
--バラガール
--Rose Girl
--Scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Special summon itself from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Add this card from GY 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)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.confilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_PLANT==RACE_PLANT
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.confilter,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,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_PLANT),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
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,LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
At the end of the Battle Phase: It becomes the End Phase of this turn.
|
--一撃離脱
--Parthian Shot
--
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(TIMING_BATTLE_END)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you Normal or Special Summon an "Aroma" monster(s) (except during the Damage Step): You can gain 1000 LP. When an opponent's monster declares an attack, while your LP are lower than your opponent's: You can Special Summon 1 "Aroma" monster from your Deck. You can only use each effect of "Aroma Gardening" once per turn.
|
--アロマガーデニング
--Aroma Gardening
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--gain lp
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id)
e2:SetCondition(s.rccon)
e2:SetTarget(s.rctg)
e2:SetOperation(s.rcop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Special Summon 1 "Aroma" monster from your Deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,{id,1})
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(s.spcon)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
end
s.listed_series={SET_AROMA}
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_AROMA) and c:IsSummonPlayer(tp)
end
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function s.rcop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_AROMA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,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 2 monsters Once per turn: You can detach 1 material from this card, then target 1 other face-up card on the field; while this monster is face-up on the field, that target's effects are negated. While that target is on the field, cards with the same name as that target, and their effects, cannot be activated.
|
--No.45 滅亡の予言者 クランブル・ロゴス
--Number 45: Crumble Logos the Prophet of Demolition
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,2,2,nil,nil,Xyz.InfiniteMats)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(Cost.DetachFromSelf(1))
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--cannnot activate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetCondition(s.actcon)
e2:SetValue(s.aclimit)
c:RegisterEffect(e2)
end
s.xyz_number=45
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
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:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetCondition(s.disablecon)
tc:RegisterEffect(e1)
end
end
function s.disablecon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
function s.actcon(e)
return e:GetHandler():GetCardTargetCount()>0
end
function s.aclimit(e,re,tp)
local g=e:GetHandler():GetCardTarget()
local cg={}
local tc=g:GetFirst()
for tc in aux.Next(g) do
table.insert(cg,tc:GetCode())
end
return re:GetHandler():IsCode(table.unpack(cg))
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
FLIP: Change the battle positions of all face-up monsters your opponent controls.
|
--グラビティ・ボール
--Gravitic Orb
local s,id=GetID()
function s.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,#sg,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if #sg>0 then
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,0)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can send 1 "Gimmick Puppet" monster from your Deck to the Graveyard.
|
--ギミック・パペット-シザー・アーム
--Gimmick Puppet Scissor Arms
local s,id=GetID()
function s.initial_effect(c)
--send to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_series={SET_GIMMICK_PUPPET}
function s.tgfilter(c)
return c:IsMonster() and c:IsSetCard(SET_GIMMICK_PUPPET) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 Spell/Trap on the field; destroy that target, and if you do, Set 1 "Artifact" monster from your Deck to your Spell & Trap Zone as a Spell. If this card in your possession is destroyed by your opponent: Your opponent skips their next Battle Phase. * The above text is unofficial and describes the card's functionality in the OCG.
|
--アーティファクト・ムーブメント
--Artifact Ignition
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE|TIMING_EQUIP)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--skip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.descon)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.listed_series={SET_ARTIFACT}
function s.filter(c)
return c:IsSetCard(SET_ARTIFACT) and c:IsMonster() and c:IsSSetable(true)
end
function s.desfilter(c)
return c:IsSpellTrap()
end
function s.desfilter2(c)
return c:IsSpellTrap() and c:GetSequence()<5
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.desfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then
if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end
if ft<0 then return false
elseif ft>0 then
return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
else
return Duel.IsExistingTarget(s.desfilter2,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft>0 then
g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
else
g=Duel.SelectTarget(tp,s.desfilter2,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
end
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:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SSet(tp,g:GetFirst())
end
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():IsPreviousControler(tp)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
if Duel.IsTurnPlayer(1-tp) and Duel.IsBattlePhase() then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(s.skipcon)
e1:SetReset(RESET_PHASE|PHASE_BATTLE|RESET_OPPO_TURN,2)
else
e1:SetReset(RESET_PHASE|PHASE_BATTLE|RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
function s.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send 1 "Trigon" equipped to a face-up "Delta Tri" you control to the Graveyard, and destroy all monsters your opponent controls.
|
--ドラゴンレーザー
--Dragon Laser
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={48568432,12079734}
function s.filter(c,tp)
local ec=c:GetEquipTarget()
return ec and ec:IsControler(tp) and c:IsCode(48568432) and ec:IsCode(12079734)
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_SZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,tp)
and Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
local sg=Duel.GetFieldGroup(1-tp,LOCATION_MZONE,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
local sg=Duel.GetFieldGroup(1-tp,LOCATION_MZONE,0)
Duel.Destroy(sg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Send 2 Spells from your hand to the GY, then target 1 Spell in your GY; add it to your hand.
|
--魔法再生
--Spell Reproduction
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.costfilter(c)
return c:IsSpell() and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,s.costfilter,2,2,REASON_COST)
end
function s.filter(c)
return c:IsSpell() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Tribute this card while "Neo Space" is on the field to Special Summon 1 "Neo-Spacian Glow Moss" from your hand or Deck.
|
--C・ピニー
--Chrysalis Pinny
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={17732278,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(17732278) 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:
|
[ Pendulum Effect ] During your Main Phase, if this card was activated this turn: You can add 1 non-Pendulum "Nouvelles" card from your Deck to your hand. If a monster(s) is Special Summoned to your opponent's field (except during the Damage Step): You can Special Summon this card. You can only use each effect of "Chef de Nouvelles" once per turn. ---------------------------------------- [ Monster Effect ] If this card on the field is Tributed and added to the Extra Deck face-up: You can place this card in your Pendulum Zone. You cannot activate the following effects of "Chef de Nouvelles" in the same Chain. Once per turn (Quick Effect): You can target 1 Effect Monster on the field; increase its Level by up to 3. Once per turn, if your opponent Special Summons a monster(s) (except during the Damage Step): You can banish 1 "Recipe" Ritual Spell from your hand, Deck, or GY; apply that card's activation effect that Ritual Summons a monster.
|
--シェフ・ド・ヌーベルズ
--Chef de Nouvelles
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Pendulum Summon procedure
Pendulum.AddProcedure(c,false)
--Activate and register it as activated this turn
local e0=Effect.CreateEffect(c)
e0:SetDescription(1160)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_HAND)
e0:SetCost(s.regop)
c:RegisterEffect(e0)
--Add 1 "Nouvelles" card from your Deck to your hand, except a Pendulum Monster
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_PZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Special Summon this card
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_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(function(e,tp,eg) return eg:IsExists(Card.IsControler,1,nil,1-tp) end)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Place this card in your Pendulum Zone
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RELEASE)
e3:SetTarget(s.pltg)
e3:SetOperation(s.plop)
c:RegisterEffect(e3)
--Increase the level of a targeted Effect monster by up to 3
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_LVCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e4:SetCountLimit(1)
e4:SetCost(Cost.HardOncePerChain(id))
e4:SetTarget(s.lvtg)
e4:SetOperation(s.lvop)
c:RegisterEffect(e4)
--Apply the effects of a 1 "Recipe" Ritual Spell
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,4))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end)
e5:SetCost(Cost.AND(s.applycost,Cost.HardOncePerChain(id)))
e5:SetTarget(s.applytg)
e5:SetOperation(s.applyop)
c:RegisterEffect(e5)
end
s.listed_series={SET_NOUVELLES,SET_RECIPE}
function s.regop(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.thfilter(c)
return c:IsSetCard(SET_NOUVELLES) and c:IsAbleToHand() and not c:IsType(TYPE_PENDULUM)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) 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,true,false,POS_FACEUP)
end
end
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_EXTRA) and Duel.CheckPendulumZones(tp) end
end
function s.plop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.lvfilter(c)
return c:IsType(TYPE_EFFECT) and c:HasLevel() and c:IsFaceup()
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,g,1,tp,1)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local lv=Duel.AnnounceLevel(tp,1,3)
--Increase its Level by up to 3
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.applyfilter(c)
return c:IsRitualSpell() and c:IsSetCard(SET_RECIPE) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
end
function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
local te=g:GetFirst():CheckActivateEffect(true,true,false)
e:SetLabel(te:GetLabel())
e:SetLabelObject(te:GetLabelObject())
local tg=te:GetTarget()
if tg then
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
te:SetLabel(e:GetLabel())
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function s.applyop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
e:SetLabel(te:GetLabel())
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
te:SetLabel(e:GetLabel())
te:SetLabelObject(e:GetLabelObject())
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be used as Synchro Material, except for the Synchro Summon of a "Dragunity" monster. This card on the field can be treated as a Level 4 monster when used for a Synchro Summon. If this card is currently equipped to a monster: You can Special Summon this equipped card.
|
--ドラグニティ-クーゼ
--Dragunity Couse
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--synchro limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(s.synlimit)
c:RegisterEffect(e1)
--Can be treated as level 4 for a Synchro Summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetValue(s.slevel)
c:RegisterEffect(e2)
--Special Summon itself while it is equipped to a monster
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(function(e) return e:GetHandler():GetEquipTarget() end)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
s.listed_series={SET_DRAGUNITY}
function s.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(SET_DRAGUNITY)
end
function s.slevel(e,c)
return 4<<16|e:GetHandler():GetLevel()
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 not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 face-up monster you control; equip 2 monsters with the same original name as that target from your hand, Deck, and/or GY to that target as Equip Spells, and if you do, it cannot attack or be destroyed by battle while equipped with those 2 cards. You cannot Special Summon for the rest of this turn after this card resolves, except monsters with the same original Type as the targeted monster. You can only activate 1 "The League of Uniform Nomenclature Strikes" per turn.
|
--同姓同名同盟罷業
--The League of Uniform Nomenclature Strikes
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Equip 2 monsters with the same original name as a target to that target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.tgfilter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,2,nil,tp,c:GetOriginalCodeRule())
end
function s.eqfilter(c,tp,code)
return c:IsOriginalCodeRule(code) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,tp) end
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end
return ft>=2 and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,2,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eqg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,2,2,nil,tp,tc:GetOriginalCodeRule())
if #eqg==2 then
local fid=e:GetFieldID()
local equip_success=false
for ec in eqg:Iter() do
if Duel.Equip(tp,ec,tc,true,true) then
equip_success=true
ec:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid)
--Equip limit
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(function(e,c) return c==tc end)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
ec:RegisterEffect(e1)
end
end
Duel.EquipComplete()
if equip_success then
local ec1,ec2=eqg:GetFirst(),eqg:GetNext()
--Cannot attack while equipped with those 2 cards
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetCondition(function(e) return e:GetHandler():GetEquipGroup():IsExists(function(ec) return ec:GetFlagEffectLabel(id)==fid end,2,nil) end)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2)
--Cannot be destroyed by battle while equipped with those 2 cards
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
tc:RegisterEffect(e3)
end
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
--Cannot Special Summon for the rest of this turn after this card resolves, except monsters with the same original Type as the targeted monster
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTargetRange(1,0)
e4:SetTarget(function(e,c) return not c:IsOriginalRace(tc:GetOriginalRace()) end)
e4:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e4,tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate this card by targeting 1 face-up monster your opponent controls; it loses 700 ATK, also it cannot attack or change its battle position. When it leaves the field, destroy this card.
|
--闇の呪縛
--Shadow Spell
local s,id=GetID()
function s.initial_effect(c)
aux.AddPersistentProcedure(c,1,aux.FilterBoolFunction(Card.IsFaceup),CATEGORY_POSITION,EFFECT_FLAG_DAMAGE_STEP,TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP,aux.StatChangeDamageStepCondition)
--eff
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.PersistentTargetFilter)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(-700)
c:RegisterEffect(e3)
--Destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(s.descon)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
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:
|
If this card is Normal or Special Summoned: You can add 1 "Vanquish Soul" Spell/Trap from your Deck to your hand. (Quick Effect): You can activate 1 of these effects, by revealing monster(s) in your hand with the listed Attribute(s); ● DARK: 1 face-up monster your opponent controls loses 500 ATK/DEF. ● DARK & EARTH: Return the 1 monster with the lowest DEF on the field to the hand (your choice, if tied). You can only use each effect of "Vanquish Soul Dr. Mad Love" once per turn, and cannot activate more than 1 in the same Chain.
|
--VSDr.マッドラヴ
--Vanquish Soul Dr. Mad Love
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Search 1 "Vanquish Soul" Spell/Trap
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCost(s.opccost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Reduce 1 opponent's monster's ATK/DEF, OR send 1 face-up monster on the field to the hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E|TIMING_DAMAGE_STEP)
e3:SetCountLimit(1,{id,1})
e3:SetCost(s.opccost)
e3:SetTarget(s.vstg)
e3:SetOperation(s.vsop)
c:RegisterEffect(e3)
end
s.listed_series={SET_VANQUISH_SOUL}
function s.opccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
end
function s.thfilter(c)
return c:IsSetCard(SET_VANQUISH_SOUL) and c:IsSpellTrap() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.vscostfilter(c,att)
return c:IsAttribute(att) and not c:IsPublic()
end
function s.vsrescon(sg)
return sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_EARTH)>0
end
function s.vstg(e,tp,eg,ep,ev,re,r,rp,chk)
local not_dmg_step=Duel.GetCurrentPhase()~=PHASE_DAMAGE
local cg1=Duel.GetMatchingGroup(s.vscostfilter,tp,LOCATION_HAND,0,nil,ATTRIBUTE_DARK)
local fg1=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local b1=#cg1>0 and #fg1>0 and (not_dmg_step or not Duel.IsDamageCalculated())
local cg2=cg1+Duel.GetMatchingGroup(s.vscostfilter,tp,LOCATION_HAND,0,nil,ATTRIBUTE_EARTH)
local fg2=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAbleToHand),tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local b2=#fg2>0 and aux.SelectUnselectGroup(cg2,e,tp,1,2,s.vsrescon,0) and not_dmg_step
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)})
e:SetLabel(op)
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=cg1:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
elseif op==2 then
local g=aux.SelectUnselectGroup(cg2,e,tp,1,2,s.vsrescon,1,tp,HINTMSG_CONFIRM,s.vsrescon)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_EITHER,LOCATION_MZONE)
end
end
function s.vsop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
local c=e:GetHandler()
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(tc,true)
tc:UpdateAttack(-500,RESET_EVENT|RESETS_STANDARD,c)
tc:UpdateDefense(-500,RESET_EVENT|RESETS_STANDARD,c)
elseif op==2 then
local g2=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsDefenseAbove,0),tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetMinGroup(Card.GetDefense)
if not g2 or #g2==0 then return end
if #g2>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
g2=g2:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
end
if #g2==0 then return end
Duel.HintSelection(g2,true)
Duel.SendtoHand(g2,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During your opponent's Main Phase (Quick Effect): You can reveal this card in your hand; Fusion Summon 1 "Frightfur" Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Material, including this card in your hand. If a "Frightfur" Fusion Monster(s) you control would be destroyed by battle or card effect, you can banish this card from your GY instead. You can only use each effect of "Edge Imp Scythe" once per turn.
|
--エッジインプ・サイズ
--Edge Imp Scythe
--Scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Fusion summon from hand
local params = {aux.FilterBoolFunction(Card.IsSetCard,SET_FRIGHTFUR),nil,nil,nil,Fusion.ForcedHandler}
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetCondition(s.condition)
e1:SetTarget(Fusion.SummonEffTG(table.unpack(params)))
e1:SetOperation(Fusion.SummonEffOP(table.unpack(params)))
c:RegisterEffect(e1)
--Destruction replacement for a "Frightfur" Fusion Monster
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
s.listed_names={id}
s.listed_series={SET_FRIGHTFUR}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase()
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(SET_FRIGHTFUR) and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT|REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can send 1 "Queen's Knight", "King's Knight", or "Jack's Knight" from your Deck to the GY; Special Summon this card from your hand, and if you do, this card's name becomes the sent monster's name until the End Phase. During the End Phase, if this card is in your GY: You can target 1 other LIGHT Warrior monster in your GY; shuffle it into the Deck, and if you do, add this card to your hand. You can only use each effect of "Joker's Knight" once per turn.
|
--ジョーカーズ・ナイト
--Joker's Knight
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Add itself to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
s.listed_names={CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT}
function s.costfilter(c)
return c:IsCode(CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT) and c:IsAbleToGraveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
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
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
--Change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(e:GetLabel())
c:RegisterEffect(e1)
end
end
function s.tdfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR)
and c:IsMonster() and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) and chkc~=c end
if chk==0 then return c:IsAbleToHand() and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Dragon monsters, including a "Rokket" monster You can discard 1 card, then target 1 face-up monster on the field; you cannot Special Summon Link-2 or lower monsters from the Extra Deck for the rest of the turn, also destroy the targeted monster, then, if it was a Link Monster, you can Special Summon any number of "Rokket" monsters with different names, from your hand or GY, up to its Link Rating. You can only use this effect of "Quadborrel Dragon" once per turn.
|
--ソーンヴァレル・ドラゴン
--Quadborrel Dragon
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
--Link Summon
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),2,2,s.lcheck)
c:EnableReviveLimit()
--Destroy 1 monster and special summon "Rokket" monsters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+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.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
s.listed_series={SET_ROKKET}
function s.lcheck(g,lc,sumtype,tp)
return g:IsExists(Card.IsSetCard,1,nil,SET_ROKKET,lc,sumtype,tp)
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_ROKKET) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--Cannot Special Summon Link-2 or lower monsters from the Extra Deck
local ge1=Effect.CreateEffect(c)
ge1:SetDescription(aux.Stringid(id,2))
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
ge1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
ge1:SetTargetRange(1,0)
ge1:SetTarget(function(_,c) return c:IsLinkBelow(2) and c:IsLocation(LOCATION_EXTRA) end)
ge1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(ge1,tp)
--Clock Lizard check
aux.addTempLizardCheck(c,tp,function(_,c) return not c:IsLinkBelow(2) end)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:IsLinkMonster() and tc:GetLink()>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
local lk=tc:GetLink()
ft=math.min(ft,lk)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,nil,e,tp)
ft=math.min(ft,g:GetClassCount(Card.GetCode))
local sg=aux.SelectUnselectGroup(g,e,tp,1,ft,aux.dncheck,1,tp,HINTMSG_SPSUMMON)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Effect Monsters If this card is Link Summoned using a Fusion, Synchro, Xyz, or Link Monster as material: You can target 1 card on the field or in either GY; banish it, also your monsters cannot attack directly for the rest of this turn. When your opponent activates a card or effect (Quick Effect): You can target 2 face-up monsters on the field, including a monster you control; banish both until the End Phase. You can only use each effect of "S:P Little Knight" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--S:Pリトルナイト
--S:P Little Knight
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Link Summon procedure
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2,2)
--Banish 1 card from the field or GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() and e:GetLabel()==1 end)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(s.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--Banish 2 face-up monsters until the End Phase
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(function(_,tp,_,ep) return ep==1-tp end)
e3:SetTarget(s.tmprmtg)
e3:SetOperation(s.tmprmop)
c:RegisterEffect(e3)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD|LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then
e:SetLabel(0)
return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,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
local c=e:GetHandler()
--Your monsters cannot attack directly this turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,2))
end
function s.valcheck(e,c)
if c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK,c,SUMMON_TYPE_LINK,e:GetHandlerPlayer()) then
e:GetLabelObject():SetLabel(1)
end
end
function s.tmprmfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e) and c:IsAbleToRemove()
end
function s.rescon(sg,e,tp,mg)
return sg:IsExists(Card.IsControler,1,nil,tp)
end
function s.tmprmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(s.tmprmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_REMOVE)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,2,tp,0)
end
function s.tmprmop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetCards(e):Filter(Card.IsAbleToRemove,nil)
if #tg==2 then
aux.RemoveUntil(tg,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:
|
If this card is Normal or Special Summoned: You can add 1 non-Warrior "Vanquish Soul" monster from your Deck to your hand. (Quick Effect): You can activate 1 of these effects, by revealing monster(s) in your hand with the listed Attribute(s); ● FIRE: This card cannot be destroyed by card effects this turn. ● FIRE & DARK: Destroy all other monsters in this card's column. You can only use each effect of "Vanquish Soul Razen" once per turn, and cannot activate more than 1 in the same Chain.
|
--VSラゼン
--Vanquish Soul Razen
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Search 1 non-Warrior "Vanquish Soul" monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCost(s.opccost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Make this card indestructible by effects, OR destroy all monsters in this card's column
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e3:SetCountLimit(1,{id,1})
e3:SetCost(s.opccost)
e3:SetTarget(s.vstg)
e3:SetOperation(s.vsop)
c:RegisterEffect(e3)
end
s.listed_series={SET_VANQUISH_SOUL}
function s.opccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
end
function s.thfilter(c)
return c:IsSetCard(SET_VANQUISH_SOUL) and c:IsMonster() and not c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.vscostfilter(c,att)
return c:IsAttribute(att) and not c:IsPublic()
end
function s.vsrescon(sg)
return sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_FIRE)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
function s.vstg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg1=Duel.GetMatchingGroup(s.vscostfilter,tp,LOCATION_HAND,0,nil,ATTRIBUTE_FIRE)
local b1=#cg1>0
local cg2=cg1+Duel.GetMatchingGroup(s.vscostfilter,tp,LOCATION_HAND,0,nil,ATTRIBUTE_DARK)
local colg=e:GetHandler():GetColumnGroup():Match(Card.IsLocation,nil,LOCATION_MZONE)
local b2=#colg>0 and aux.SelectUnselectGroup(cg2,e,tp,1,2,s.vsrescon,0)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)})
e:SetLabel(op)
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=cg1:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetCategory(0)
elseif op==2 then
local g=aux.SelectUnselectGroup(cg2,e,tp,1,2,s.vsrescon,1,tp,HINTMSG_CONFIRM,s.vsrescon)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetCategory(CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,colg,#colg,0,0)
end
end
function s.vsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local op=e:GetLabel()
if op==1 and c:IsFaceup() then
--Cannot be destroyed by card effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(3001)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
elseif op==2 then
local cg=c:GetColumnGroup():Match(Card.IsLocation,nil,LOCATION_MZONE)
if #cg==0 then return end
Duel.Destroy(cg,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Normal Summon/Set this card without Tributing, but its original ATK becomes 1500. During the Main Phase (Quick Effect): You can target 1 monster your opponent controls with ATK less than or equal to this card; return this card to the hand, and if you do, take control of that opponent's monster until the End Phase. You can only use this effect of "Seleglare the Luminous Lunar Dragon" once per turn.
|
--眩月龍セレグレア
--Seleglare the Luminous Lunar Dragon
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
e1:SetOperation(s.ntop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_CONTROL)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e3:SetCondition(s.concon)
e3:SetTarget(s.contg)
e3:SetOperation(s.conop)
c:RegisterEffect(e3)
end
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function s.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD))
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1500)
c:RegisterEffect(e1)
end
function s.concon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.confilter(c,atk)
return c:IsFaceup() and c:GetAttack()<=atk and c:IsControlerCanBeChanged()
end
function s.contg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local atk=c:GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.confilter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(s.confilter,tp,0,LOCATION_MZONE,1,nil,atk) and c:IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,s.confilter,tp,0,LOCATION_MZONE,1,1,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function s.conop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~0 and tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate only during a turn in which you destroyed a Defense Position monster your opponent controlled. Select 1 Level 8 monster you control. During this turn, the selected monster can attack twice.
|
--破壊神の系譜
--Lineage of Destruction
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
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_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end)
end
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:IsPreviousLocation(LOCATION_MZONE) and tc:IsPreviousPosition(POS_DEFENSE) then
if tc:GetReasonPlayer()==0 and tc:IsPreviousControler(1) then p1=true end
if tc:GetReasonPlayer()==1 and tc:IsPreviousControler(0) then 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 and Duel.IsTurnPlayer(tp)
and (Duel.IsAbleToEnterBP() or Duel.IsBattlePhase())
end
function s.filter(c)
return c:IsFaceup() and c:IsLevelAbove(8) and c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
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 Tribute this card; Special Summon 1 Dragon-Type monster from your hand or Graveyard, except "Assault Wyvern".
|
--アサルトワイバーン
--Assault Wyvern
local s,id=GetID()
function s.initial_effect(c)
--search
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_DESTROYING)
e1:SetCondition(aux.bdocon)
e1:SetCost(Cost.SelfTribute)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_names={id}
function s.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE|LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_HAND)
end
function s.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,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE|LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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 Special Summoned: You can Special Summon 1 face-up Pendulum Monster from your Extra Deck, but you cannot Special Summon while you control that face-up monster, except Pendulum Monsters. If this card is in your GY: You can banish 2 other Fusion, Synchro, Xyz, and/or Pendulum Monsters from your GY; Special Summon this card. You can only use 1 "Odd-Eyes Solblaze Dragon" effect per turn, and only once that turn.
|
--オッドアイズ・ソルブレイズ・ドラゴン
--Odd-Eyes Solblaze Dragon
--Scripted by The Razgriz
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)
--Special Summon 1 face-up Pendulum Monster from your Extra Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.pendsptg)
e1:SetOperation(s.pendspop)
c:RegisterEffect(e1)
--Special Summon this card from your GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(s.selfspcost)
e2:SetTarget(s.selfsptg)
e2:SetOperation(s.selfspop)
c:RegisterEffect(e2)
end
function s.pendspfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.pendsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.pendspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.pendspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.pendspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
--You cannot Special Summon while you control that face-up monster, except Pendulum Monsters
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetCondition(function(e) return e:GetHandler():IsControler(e:GetOwnerPlayer()) end)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
sc:RegisterEffect(e1,true)
end
end
function s.splimit(e,c,tp,sumtp,sumpos)
if c:IsMonster() then
return not c:IsType(TYPE_PENDULUM)
else
return not c:IsOriginalType(TYPE_PENDULUM)
end
end
function s.selfspcostfilter(c,tp)
return c:IsType(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_PENDULUM) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
and aux.SpElimFilter(c,true)
end
function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.selfspcostfilter,tp,LOCATION_GRAVE|LOCATION_MZONE,0,2,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.selfspcostfilter,tp,LOCATION_GRAVE|LOCATION_MZONE,0,2,2,c,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local cost_chk=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
e:SetLabel(0)
return cost_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Face-up Equip Cards you control cannot be destroyed by card effects. This card gains 500 ATK for each Equip Card equipped to this card.
|
--武装神竜プロテクト・ドラゴン
--Armed Protector Dragon
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_EQUIP))
e1:SetValue(1)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(s.val)
c:RegisterEffect(e2)
end
function s.val(e,c)
return c:GetEquipCount()*500
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Elemental HERO Avian" + "Elemental HERO Burstinatrix" + "Elemental HERO Clayman" + "Elemental HERO Bubbleman" Must be Fusion Summoned. While face-up on the field, this card is also WIND, WATER, FIRE, and EARTH Attribute. When this card is Fusion Summoned: Shuffle all banished cards into the Deck(s). Gains 300 ATK for each monster your opponent controls with the same Attribute as this card.
|
--E・HERO エリクシーラー
--Elemental HERO Electrum
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,21844576,58932615,84327329,79979666)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(aux.fuslimit)
c:RegisterEffect(e2)
--attribute
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_ADD_ATTRIBUTE)
e3:SetValue(0xf)
c:RegisterEffect(e3)
--return
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(s.retcon)
e4:SetTarget(s.rettg)
e4:SetOperation(s.retop)
c:RegisterEffect(e4)
--atk
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetValue(s.val)
c:RegisterEffect(e5)
end
s.material_setcode={SET_HERO,SET_ELEMENTAL_HERO}
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFusionSummoned()
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
function s.val(e,c)
return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsAttribute,c:GetAttribute()),c:GetControler(),0,LOCATION_MZONE,nil)*300
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Ritual Summon this card with any "Vendread" Ritual Spell. During the Main Phase (Quick Effect): You can Tribute 1 other Zombie monster; this card gains ATK equal to the Tributed monster's original ATK until the end of this turn. If you control "Revendread Slayer" and this card is in your GY: You can Special Summon this card, but banish it when it leaves the field. You can only use each effect of "Vendread Scavenger" once per turn.
|
--ヴェンデット・スカヴェンジャー
--Vendread Scavenger
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Tribute 1 Zombie monster to increase ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetCost(s.atkcost)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--Special Summon itself from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
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_VENDREAD}
s.listed_names={4388680}
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,false,nil,c,RACE_ZOMBIE) end
local g=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,false,nil,c,RACE_ZOMBIE)
e:SetLabel(g:GetFirst():GetTextAttack())
Duel.Release(g,REASON_COST)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
--Increase ATK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e1)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,4388680),tp,LOCATION_ONFIELD,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
--Banish itself if it would leave the field
local e1=Effect.CreateEffect(c)
e1:SetDescription(3300)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If your opponent's LP are at least 2000 higher than yours, you can Special Summon this card (from your hand). You can target 1 "Utopia" monster you control; equip this monster on the field to that target. It gains 2000 ATK. Once per turn, while this card is equipped to a monster, negate the first Trap Card or effect activated on your opponent's field, when it resolves. You can only control 1 "ZW - Eagle Claw".
|
--ZW-荒鷲激神爪
--ZW - Eagle Claw
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--Special Summon itself from the 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)
c:RegisterEffect(e1)
--Equip itself to an "Utopia" monster
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.eqcon)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
aux.AddZWEquipLimit(c,s.eqcon,function(tc,c,tp) return s.filter(tc) and tc:IsControler(tp) end,s.equipop,e2)
--Negate the effect of an opponent's Trap card
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.negcon)
e3:SetOperation(s.negop)
c:RegisterEffect(e3)
aux.DoubleSnareValidity(c,LOCATION_SZONE)
end
s.listed_series={SET_UTOPIA}
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-2000
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function s.eqcon(e)
return e:GetHandler():CheckUniqueOnField(e:GetHandlerPlayer())
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(SET_UTOPIA)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:GetControler()~=tp or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
s.equipop(c,e,tp,tc)
end
function s.equipop(c,e,tp,tc)
if not aux.EquipAndLimitRegister(c,e,tp,tc) then return end
--Increase the ATK of the equipped monster by 2000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetEquipTarget()
and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_SZONE
and re:IsTrapEffect() and Duel.IsChainDisablable(ev)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.NegateEffect(ev)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate 1 of these effects; ● Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your hand. ● Add to your hand or Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your GY. You can only activate 1 "Dogmatika Encounter" per turn.
|
--ドラグマ・エンカウンター
--Dogmatika Encounter
--Scripted by ahtelel
local s,id=GetID()
function s.initial_effect(c)
--Activate 1 of these effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
end
s.listed_series={SET_DOGMATIKA}
s.listed_names={CARD_ALBAZ}
function s.handspfilter(c,e,tp)
return (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.thspfilter(c,e,tp,mzone_chk)
return (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) and c:IsMonster() and (c:IsAbleToHand()
or (mzone_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b1=mzone_chk and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mzone_chk)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
elseif op==2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
--Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your hand
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif op==2 then
--Add to your hand or Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your GY
local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3))
local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mzone_chk):GetFirst()
if not sc then return end
aux.ToHandOrElse(sc,tp,
function() return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end,
function() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end,
aux.Stringid(id,4)
)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 monsters including an "Evil Eye" monster Gains 100 ATK for each "Evil Eye" card with different names in your GY. If this card is equipped with "Evil Eye of Selene" (Quick Effect): You can target 1 Effect Monster your opponent controls; negate its effects until the end of this turn. You can only use this effect of "Gorgon, Empress of the Evil Eyed" once per turn. Once per turn, during the next Standby Phase after this effect was activated: Destroy 1 monster this card points to.
|
--呪眼の女王 ゴルゴーネ
--Gorgon, Empress of the Evil Eyed
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Link.AddProcedure(c,nil,2,2,s.matcheck)
--Gain 100 ATK for each "Evil Eye" card in the GY
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(s.atkval)
c:RegisterEffect(e1)
--Negate the effects of 1 monster your opponent controls
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,id)
e2:SetCondition(s.discon)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
--Destroy 1 monster this cards points to
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetCountLimit(1)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
s.listed_names={CARD_EVIL_EYE_SELENE}
s.listed_series={SET_EVIL_EYE}
function s.matcheck(g,lc,sumtype,tp)
return g:IsExists(Card.IsSetCard,1,nil,SET_EVIL_EYE,lc,sumtype,tp)
end
function s.atkval(e,c)
local g=Duel.GetMatchingGroup(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,SET_EVIL_EYE)
return g:GetClassCount(Card.GetCode)*100
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local eg=c:GetEquipGroup()
return #eg>0 and eg:IsExists(Card.IsCode,1,nil,CARD_EVIL_EYE_SELENE)
end
function s.filter(c)
return c:IsType(TYPE_EFFECT) and c:IsNegatableMonster()
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
if Duel.IsPhase(PHASE_STANDBY) then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY,EFFECT_FLAG_OATH,2,Duel.GetTurnCount())
else
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY,EFFECT_FLAG_OATH,1)
end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e3)
end
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local label=e:GetHandler():GetFlagEffectLabel(id)
return label and label~=Duel.GetTurnCount()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lg=e:GetHandler():GetLinkedGroup()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,lg,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=c:GetLinkedGroup()
if #g>0 then
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
g=g:Select(tp,1,1,nil)
end
Duel.Destroy(g,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
3 "Gladiator Beast" monsters Must first be Special Summoned (from your Extra Deck) by shuffling the above cards you control into the Deck. (You do not use "Polymerization".) Cannot be destroyed by battle. If this card attacks or is attacked, your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Battle Phase, if this card attacked or was attacked: You can shuffle it into the Extra Deck; Special Summon 2 "Gladiator Beast" monsters from your Deck.
|
--剣闘獣ネロキウス
--Gladiator Beast Nerokius
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_GLADIATOR),3)
Fusion.AddContactProc(c,s.contactfil,s.contactop,s.splimit)
--battle indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--actlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetValue(1)
e4:SetCondition(s.actcon)
c:RegisterEffect(e4)
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,1))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_PHASE|PHASE_BATTLE)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.spcon)
e6:SetCost(s.spcost)
e6:SetTarget(s.sptg)
e6:SetOperation(s.spop)
c:RegisterEffect(e6)
end
s.listed_series={SET_GLADIATOR}
s.material_setcode=SET_GLADIATOR
function s.contactfil(tp)
return Duel.GetMatchingGroup(function(c) return c:IsMonster() and c:IsAbleToDeckOrExtraAsCost() end,tp,LOCATION_ONFIELD,0,nil)
end
function s.contactop(g,tp)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST|REASON_MATERIAL)
end
function s.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function s.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToExtraAsCost() end
Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsSetCard(SET_GLADIATOR) and c:IsCanBeSpecialSummoned(e,122,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,2,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp)
if #g>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local tc=sg:GetFirst()
Duel.SpecialSummonStep(tc,122,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD_DISABLE,0,0)
tc=sg:GetNext()
Duel.SpecialSummonStep(tc,122,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD_DISABLE,0,0)
Duel.SpecialSummonComplete()
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate 1 of these effects (but you can only use each effect of "Yummy☆Surprise" once per turn); ● Target 2 LIGHT Beast monsters you control and 2 cards your opponent controls; return them to the hand. ● Special Summon 1 "Yummy" monster from your hand or GY, but it cannot attack directly this turn. ● Return 1 Field Spell from your face-up field or GY to the hand, then you can place 1 "Yummy" Field Spell from your hand, face-up on your field.
|
--ヤミー☆サプライズ
--Yummy☆Surprise
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Activate 1 of these effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E)
e1:SetCost(s.effcost)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
end
s.listed_series={SET_YUMMY}
function s.monoppthfilter(c,e,tp)
return ((c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST) and c:IsControler(tp)) or c:IsControler(1-tp))
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function s.rescon(sg,e,tp,mg)
return sg:FilterCount(Card.IsControler,nil,tp)==2
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_YUMMY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.fieldspellthfilter(c)
return c:IsFieldSpell() and c:IsFaceup() and c:IsAbleToHand()
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(-100)
local g=Duel.GetMatchingGroup(s.monoppthfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,nil,e,tp)
local b1=not Duel.HasFlagEffect(tp,id) and #g>=4
and aux.SelectUnselectGroup(g,e,tp,4,4,s.rescon,0)
local b2=not Duel.HasFlagEffect(tp,id+1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
local b3=not Duel.HasFlagEffect(tp,id+2)
and Duel.IsExistingMatchingCard(s.fieldspellthfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 or b3 end
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local cost_skip=e:GetLabel()~=-100
local g=Duel.GetMatchingGroup(s.monoppthfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,nil,e,tp)
local b1=not Duel.HasFlagEffect(tp,id) and #g>=4
and aux.SelectUnselectGroup(g,e,tp,4,4,s.rescon,0)
local b2=not Duel.HasFlagEffect(tp,id+1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
local b3=not Duel.HasFlagEffect(tp,id+2)
and Duel.IsExistingMatchingCard(s.fieldspellthfilter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil)
if chk==0 then e:SetLabel(0) return b1 or b2 or b3 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)},
{b3,aux.Stringid(id,3)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
if not cost_skip then Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end
local tg=aux.SelectUnselectGroup(g,e,tp,4,4,s.rescon,1,tp,HINTMSG_RTOHAND)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,4,tp,0)
elseif op==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(0)
if not cost_skip then Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE|PHASE_END,0,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
elseif op==3 then
e:SetCategory(CATEGORY_TOHAND)
e:SetProperty(0)
if not cost_skip then Duel.RegisterFlagEffect(tp,id+2,RESET_PHASE|PHASE_END,0,1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD|LOCATION_GRAVE)
end
end
function s.plfilter(c)
return c:IsSetCard(SET_YUMMY) and c:IsFieldSpell() and not c:IsForbidden()
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
--Return 2 LIGHT Beast monsters you control and 2 cards your opponent controls to the hand
local tg=Duel.GetTargetCards(e)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
elseif op==2 then
--Special Summon 1 "Yummy" monster from your hand or GY, but it cannot attack directly this turn
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
--It cannot attack directly this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3207)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
sc:RegisterEffect(e1)
end
elseif op==3 then
--Return 1 Field Spell from your face-up field or GY to the hand, then you can place 1 "Yummy" Field Spell from your hand face-up on your field
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.fieldspellthfilter),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,1,nil):GetFirst()
if sc and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
if Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local plc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if plc then
Duel.BreakEffect()
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(plc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Tribute this card; Special Summon 1 Cyberse monster from your Deck, except "Armored Bitron", but negate its effects, also you cannot Special Summon for the rest of this turn, except Cyberse monsters. If a Link-3 or higher Link Monster you control is destroyed by battle or an opponent's card effect, while this card is in your GY: You can Special Summon this card, but banish it when it leaves the field. You can only use each effect of "Armored Bitron" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
|
--アーマード・ビットロン
--Armored Bitron
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
--Special summon 1 cyberse monster from deck
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.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Special summon itself from GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_names={id}
function s.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(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_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)
local ge1=Effect.CreateEffect(e:GetHandler())
ge1:SetDescription(aux.Stringid(id,2))
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
ge1:SetTargetRange(1,0)
ge1:SetTarget(s.splimit)
ge1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(ge1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_CYBERSE)
end
function s.filter(c,p)
return c:IsLinkAbove(3) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousControler()==p and (c:IsReason(REASON_BATTLE)
or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=p)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,tp) and not eg:IsContains(e:GetHandler())
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:
|
When this card is changed from Attack Position to Defense Position, you can place any number of cards from your hand at the bottom of your Deck in any order you desire.
|
--ヤドカリュー
--Yado Karu
local s,id=GetID()
function s.initial_effect(c)
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHANGE_POS)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_ATTACK) and e:GetHandler():IsPosition(POS_DEFENSE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,99,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During damage calculation, when you are about to take 2000 or more battle damage: Gain 4000 LP first.
|
--体力増強剤スーパーZ
--Nutrient Z
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>=2000
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,4000)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,4000,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Monsters cannot attack face-down Defense Position monsters, but can attack directly if all monsters their opponent controls are face-down Defense Position. Your opponent takes no damage. When an opponent's monster declares a direct attack: You can add 1 "Ghostrick" card from your Deck to your hand.
|
--ゴーストリック・パレード
--Ghostrick Parade
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)
--atklimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(aux.TargetBoolFunction(Card.IsFacedown))
c:RegisterEffect(e2)
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DIRECT_ATTACK)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(s.dirtg)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(s.thcon)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CHANGE_DAMAGE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(0,1)
e5:SetValue(0)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e6)
end
s.listed_series={SET_GHOSTRICK}
function s.dirtg(e,c)
return not Duel.IsExistingMatchingCard(Card.IsFaceup,c:GetControler(),0,LOCATION_MZONE,1,nil)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function s.filter(c)
return c:IsSetCard(SET_GHOSTRICK) 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)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent Summons a monster(s) with 1500 or more ATK: Destroy that monster(s) with 1500 or more ATK, and if you do, banish it.
|
--奈落の落とし穴
--Bottomless Trap Hole
local s,id=GetID()
function s.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetTarget(s.target)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(s.target2)
e3:SetOperation(s.activate2)
c:RegisterEffect(e3)
end
function s.filter(c,tp,ep)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1500
and ep~=tp and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return s.filter(tc,tp,ep) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>=1500 then
Duel.Destroy(tc,REASON_EFFECT,LOCATION_REMOVED)
end
end
function s.filter2(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp
and c:IsAbleToRemove()
end
function s.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter2,1,nil,tp) end
local g=eg:Filter(s.filter2,nil,tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.filter3(c,e,tp)
return c:IsFaceup() and c:GetAttack()>=1500 and not c:IsSummonPlayer(tp)
and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE)
end
function s.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.filter3,nil,e,tp)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If 2 or more cards are in the same column, you can Special Summon this card (from your hand) in that column. You can only Special Summon "Mekk-Knight Yellow Star" once per turn this way. You can banish 1 "Mekk-Knight" monster from your GY, then target 1 Spell/Trap in this card's column; destroy it.
|
--黄華の機界騎士
--Mekk-Knight Yellow Star
--Scripted by Eerie Code
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:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetValue(s.hspval)
c:RegisterEffect(e1)
--Destroy 1 Spell/Trap in this card's column
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
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.operation)
c:RegisterEffect(e2)
end
s.listed_series={SET_MEKK_KNIGHT}
function s.cfilter(c)
return c:GetColumnGroupCount()>0
end
function s.hspval(e,c)
local tp=c:GetControler()
local zone=0
local lg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=(zone|tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
return 0,zone
end
function s.costfilter(c)
return c:IsSetCard(SET_MEKK_KNIGHT) and c:IsMonster() and c:IsAbleToRemoveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.filter(c,g)
return c:IsSpellTrap() and g:IsContains(c)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cg=e:GetHandler():GetColumnGroup()
if chkc then return s.filter(chkc,cg) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,cg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,cg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn: You can declare 1 card name; until the end of your opponent's next turn, apply these effects to all cards whose original name is the card name you declared. ● They cannot be placed on the field. ● They cannot be activated, nor can their effects be activated or applied. ● They cannot be Summoned or Set. ● They cannot attack, nor can they change their battle positions. ● They cannot be used as material for a Special Summon that requires materials. * The above text is unofficial and describes the card's functionality in the OCG.
|
--サイキック・ブロッカー
--Psi-Blocker
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_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)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
e:GetHandler():SetHint(CHINT_CARD,ac)
--forbidden
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_FORBIDDEN)
e1:SetTargetRange(0x7f,0x7f)
e1:SetTarget(s.bantg)
e1:SetLabel(ac)
e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
function s.bantg(e,c)
return c:IsCode(e:GetLabel())
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 4 monsters You can detach 1 material from this card; take 1 Pyro monster from your Deck and either add it to your hand or send it to the GY. If this card is banished and you control a Pyro monster: You can Special Summon this card, and if you do, it gains ATK equal to the number of your currently banished monsters x 100 until the end of this turn. You can only use each effect of "Infernal Flame Banshee" once per turn.
|
--ヘルフレイムバンシー
--Infernal Flame Banshee
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure
Xyz.AddProcedure(c,nil,4,2)
--Take 1 Pyro monster from your Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.DetachFromSelf(1,1,nil))
e1:SetTarget(s.thtgtg)
e1:SetOperation(s.thtgop)
c:RegisterEffect(e1)
--Special Summon this card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.thtgfilter(c)
return c:IsRace(RACE_PYRO) 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,2))
local tc=Duel.SelectMatchingCard(tp,s.thtgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if not tc then return end
aux.ToHandOrElse(tc,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_PYRO),tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsMonster),tp,LOCATION_REMOVED,0,nil)
if ct>0 then
c:UpdateAttack(ct*100,RESETS_STANDARD_PHASE_END)
end
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Special Summoned. If you Tribute Summon this card, the Tributes must be DARK. Cannot be Tributed by card effects while face-up on the field. Once per turn, during your opponent's Draw Phase, before their normal draw: Look at the top card of your opponent's Deck, and if you do, place that card on either the top or bottom of their Deck.
|
--魔王ディアボロス
--Diabolos, King of the Abyss
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)
--tribute limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRIBUTE_LIMIT)
e2:SetValue(s.tlimit)
c:RegisterEffect(e2)
--release limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UNRELEASABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
--confirm deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PREDRAW)
e4:SetCondition(s.cfcon)
e4:SetOperation(s.cfop)
c:RegisterEffect(e4)
end
function s.tlimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
function s.cfcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0
end
function s.cfop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(1-tp,1)
Duel.ConfirmCards(tp,g)
local tc=g:GetFirst()
local opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
if opt==1 then
Duel.MoveSequence(tc,opt)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
[ Pendulum Effect ] During your Main Phase: You can add 1 "Zefra" Pendulum Monster from your Deck to your Extra Deck face-up, and if you do, change this card's Pendulum Scale to be the same as that Pendulum Monster's, until the end of this turn. You can only use this effect of "Zefraath" once per turn. ---------------------------------------- [ Monster Effect ] Cannot be Normal Summoned/Set. Must be Special Summoned (from your face-up Extra Deck) by Tributing all monsters you control, including at least 3 "Zefra" monsters, and cannot be Special Summoned by other ways. After you Special Summon this card, you can conduct 1 Pendulum Summon of a "Zefra" monster(s) during your Main Phase this turn, in addition to your Pendulum Summon. (You can only gain this effect once per turn.) Once per turn: You can Tribute 1 monster; Special Summon 1 "Zefra" monster from your Deck.
|
--智天の神星龍
--Zefraath
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Pendulum.AddProcedure(c)
c:AddMustBeSpecialSummoned()
--Must be Special Summoned (from your face-up Extra Deck) by Tributing all monsters you control, including at least 3 "Zefra" monsters
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.selfspcon)
e0:SetOperation(s.selfspop)
c:RegisterEffect(e0)
--Add 1 "Zefra" Pendulum Monster from your Deck to your Extra Deck, face-up, and if you do, change this card's Pendulum Scale to be the same as that Pendulum Monster's, until the end of this turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.textg)
e1:SetOperation(s.texop)
c:RegisterEffect(e1)
--After you Special Summon this card, you can conduct 1 Pendulum Summon of a "Zefra" monster(s) during your Main Phase this turn, in addition to your Pendulum Summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(function(e,tp) Pendulum.GrantAdditionalPendulumSummon(e:GetHandler(),function(c) return c:IsSetCard(SET_ZEFRA) end,tp,LOCATION_HAND|LOCATION_EXTRA,aux.Stringid(id,2),aux.Stringid(id,3),id) end)
c:RegisterEffect(e2)
--Special Summon 1 "Zefra" monster from your Deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,4))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(s.deckspcost)
e3:SetTarget(s.decksptg)
e3:SetOperation(s.deckspop)
c:RegisterEffect(e3)
end
s.listed_series={SET_ZEFRA}
function s.selfspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local rg=Duel.GetReleaseGroup(tp)
return (#g>0 or #rg>0) and g:FilterCount(Card.IsReleasable,nil)==#g
and g:FilterCount(Card.IsSetCard,nil,SET_ZEFRA)>=3
end
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetReleaseGroup(tp)
Duel.Release(rg,REASON_COST)
end
function s.texfilter(c,scale)
return c:IsSetCard(SET_ZEFRA) and c:IsType(TYPE_PENDULUM) and not c:IsScale(scale)
end
function s.textg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.texfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetScale()) end
end
function s.texop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local sc=Duel.SelectMatchingCard(tp,s.texfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetScale()):GetFirst()
if sc and Duel.SendtoExtraP(sc,tp,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_EXTRA) then
--Change this card's Pendulum Scale to be the same as that Pendulum Monster's, until the end of this turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(sc:GetLeftScale())
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
e2:SetValue(sc:GetRightScale())
c:RegisterEffect(e2)
end
end
function s.deckspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,aux.ReleaseCheckMMZ,nil) end
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,aux.ReleaseCheckMMZ,nil)
Duel.Release(g,REASON_COST)
end
function s.deckspfilter(c,e,tp)
return c:IsSetCard(SET_ZEFRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.decksptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.deckspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.deckspfilter,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:
|
Banish this card, and as many cards as possible from your hand, field, and GY, face-down, and if you do, Special Summon up to 3 copies of "Blue-Eyes White Dragon" from your Deck. You cannot Normal or Special Summon monsters the turn you activate this card, except "Blue-Eyes White Dragon".
|
--青き眼の激臨
--Rage with Eyes of Blue
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
s.listed_names={CARD_BLUEEYES_W_DRAGON}
function s.counterfilter(c)
return c:IsCode(CARD_BLUEEYES_W_DRAGON)
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.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil)
end
function s.splimit(e,c)
return not c:IsCode(CARD_BLUEEYES_W_DRAGON)
end
function s.spfilter(c,e,tp)
return c:IsCode(CARD_BLUEEYES_W_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,0,nil,tp,POS_FACEDOWN)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and #g>0 and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,0,nil,tp,POS_FACEDOWN)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,ft,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand) by Tributing 1 "Dark Magician", and cannot be Special Summoned by other ways. Each time a Normal Spell Card is activated, inflict 1000 damage to your opponent immediately after it resolves.
|
--黒魔導の執行官
--Dark Eradicator Warlock
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(aux.chainreg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.dmgcon)
e4:SetOperation(s.dmgop)
c:RegisterEffect(e4)
end
s.listed_names={CARD_DARK_MAGICIAN}
function s.spcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,false,1,true,c,c:GetControler(),nil,false,nil,CARD_DARK_MAGICIAN)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,false,true,true,c,nil,nil,false,nil,CARD_DARK_MAGICIAN)
if g 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.Release(g,REASON_COST)
g:DeleteGroup()
end
function s.dmgcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetActiveType()==TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetFlagEffect(1)>0
end
function s.dmgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
(This card is always treated as a "Morganite" card.) When an opponent's monster declares an attack: You can banish 1 "Morganite" Spell from your GY; negate that attack. You can only use each of the following effects of "Morgana the Witch of Eyes" once per turn. If this card is Normal or Special Summoned: You can add 1 "Morganite" Spell from your Deck to your hand. If you have 3 or more "Morganite" Spells with different names in your GY and/or banishment: You can change the ATK of all face-up monsters your opponent controls to 0.
|
--瞳の魔女モルガナ
--Morgana the Witch of Eyes
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Negate the attack of an opponent's monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end)
e1:SetCost(s.negatkcost)
e1:SetTarget(s.negatktg)
e1:SetOperation(function() Duel.NegateAttack() end)
c:RegisterEffect(e1)
--Add 1 "Morganite" Spell from your Deck to your hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Change the ATK of all face-up monsters your opponent controls to 0.
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,{id,1})
e4:SetCondition(s.atkcon)
e4:SetTarget(s.atktg)
e4:SetOperation(s.atkop)
c:RegisterEffect(e4)
end
s.listed_series={SET_MORGANITE}
function s.negatkcostfilter(c)
return c:IsSetCard(SET_MORGANITE) and c:IsSpell() and c:IsAbleToRemoveAsCost()
end
function s.negatkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.negatkcostfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.negatkcostfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.negatktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttacker():IsOnField() and Duel.GetAttacker():IsRelateToBattle() end
end
function s.thfilter(c)
return c:IsSetCard(SET_MORGANITE) and c:IsSpell() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.morganitefilter(c)
return c:IsSetCard(SET_MORGANITE) and c:IsSpell() and c:IsFaceup()
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.morganitefilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,nil)
return g:GetClassCount(Card.GetCode)>=3
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,1-tp,0)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,nil)
for tc in g:Iter() do
--Change their ATKs to 0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 "Photon" monsters You can Tribute this card; Special Summon, from your Graveyard, both of the Fusion Material Monsters used for the Fusion Summon of this card.
|
--ツイン・フォトン・リザード
--Twin Photon Lizard
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_PHOTON),2)
--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:SetCost(Cost.SelfTribute)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
s.listed_series={SET_PHOTON}
s.material_setcode=SET_PHOTON
function s.mgfilter(c,e,tp,fusc,mg)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE)
and (c:GetReason()&(REASON_FUSION|REASON_MATERIAL))==(REASON_FUSION|REASON_MATERIAL) and c:GetReasonCard()==fusc
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and fusc:CheckFusionMaterial(mg,c,PLAYER_NONE+65536)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetMaterial()
if chk==0 then
local ct=#g
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
return ct>0 and ft>=ct and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
and e:GetHandler():IsFusionSummoned()
and g:FilterCount(s.mgfilter,nil,e,tp,e:GetHandler(),g)==ct
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
local g=e:GetHandler():GetMaterial()
local ct=#g
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct
and g:FilterCount(s.mgfilter,nil,e,tp,e:GetHandler(),g)==ct 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:
|
While "Gaia the Dragon Champion" is in your Monster Zone, your opponent's monsters can only target "Gaia the Dragon Champion" for attacks. When an attack is declared involving your "Gaia the Dragon Champion": You can target 1 card on the field; destroy it. You can only use this effect of "Spiral Discharge" once per turn.
|
--螺旋砲撃
--Spiral Discharge
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_ATTACK)
c:RegisterEffect(e1)
--Destroy 1 card on the field
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--Prevent attacks on monsters while you control "Gaia the Dragon Champion"
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(s.actcon)
e3:SetValue(s.atktg)
c:RegisterEffect(e3)
end
s.listed_names={CARD_GAIA_CHAMPION}
function s.actcon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_GAIA_CHAMPION),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.atktg(e,c)
return c:GetCode()~=CARD_GAIA_CHAMPION
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local dc=Duel.GetAttackTarget()
return (tc:IsCode(CARD_GAIA_CHAMPION) and tc:IsControler(tp))
or (dc and dc:IsCode(CARD_GAIA_CHAMPION) and dc:IsControler(tp))
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return 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,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:
|
2+ monsters, including a Link Monster If a card(s) on the field is destroyed by card effect, except by "Unchained Abomination" (except during the Damage Step): You can target 1 card on the field; destroy it. When another monster is destroyed by battle: You can target 1 card on the field; destroy it. During the End Phase: You can target 1 card on the field; destroy it. You can only use each effect of "Unchained Abomination" once per turn.
|
--破械雙王神ライゴウ
--Unchained Abomination
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--link summon
Link.AddProcedure(c,nil,2,4,s.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--destroy!
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(id,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.descon2)
c:RegisterEffect(e2)
--destroy!!
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(id,0))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCondition(aux.TRUE)
e3:SetCountLimit(1,{id,2})
c:RegisterEffect(e3)
end
s.listed_names={id}
function s.lcheck(g,lc,sumtype,tp)
return g:IsExists(Card.IsType,1,nil,TYPE_LINK,lc,sumtype,tp)
end
function s.cfilter(c)
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil) and not (re and re:GetHandler():IsCode(id))
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,PLAYER_ALL,LOCATION_ONFIELD)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsReason,1,e:GetHandler(),REASON_BATTLE)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per turn, during the Standby Phase: You can Special Summon 1 "DOG Fighter Token" (Machine-Type/DARK/Level 6/ATK 2000/DEF 2400). If this card is destroyed by battle or card effect and sent to the Graveyard: You can banish this card from your Graveyard; Special Summon 1 Level 5 or lower "Kozmo" monster from your Deck.
|
--Kozmo-ドッグファイター
--Kozmo DOG Fighter
local s,id=GetID()
function s.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetTarget(s.tktg)
e1:SetOperation(s.tkop)
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_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_names={29491335}
s.listed_series={SET_KOZMO}
function s.tktg(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,2000,2400,6,RACE_MACHINE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function s.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,2400,6,RACE_MACHINE,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,id+1)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_GRAVE) and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_KOZMO) and c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Battle Phase: Immediately after this effect resolves, Normal Summon 1 monster. You can only activate 1 "Arrivalrivals" per turn.
|
--ライバル・アライバル
--Arrivalrivals
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.IsBattlePhase()
end
function s.filter(c)
return c:IsSummonable(true,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 5 monsters You can detach 1 material from this card, then target 1 Level 5 monster in either GY; Special Summon it to either field. If a face-up Level 5 monster you control is destroyed by battle, or leaves the field by an opponent's card effect, while you control this monster: You can add to your hand or Special Summon, 1 Level 5 monster from your Deck. You can only use each effect of "Imperial Princess Quinquery" once per turn.
|
--召煌女クインクエリ
--Imperial Princess Quinquery
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure
Xyz.AddProcedure(c,nil,5,2)
--Special Summon 1 Level 5 monster from either GY to either field
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(Cost.DetachFromSelf(1,1,nil))
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Add to hand or Special Summon 1 Level 5 monster from the Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsLevel(5) and
((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
or (Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,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 not tc:IsRelateToEffect(e) then return end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
if not (b1 or b2) then return end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,2)},
{b2,aux.Stringid(id,3)})
local target_player=op==1 and tp or 1-tp
Duel.SpecialSummon(tc,0,tp,target_player,false,false,POS_FACEUP)
end
function s.filter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousLevelOnField()==5 and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,tp,rp)
end
function s.cfilter(c,e,tp,ft)
return c:IsLevel(5) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,4))
local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst()
if not tc then return end
aux.ToHandOrElse(tc,tp,
function()
return ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end,
function()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end,
aux.Stringid(id,5)
)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
3 Level 5 monsters Once per turn: You can detach 1 material from this card; send the top 3 cards of your opponent's Deck to the GY, then, if any monsters were sent to the GY by this effect, destroy cards your opponent controls, up to the number of monsters sent.
|
--重機王ドボク・ザーク
--Digvorzhak, King of Heavy Industry
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,5,3)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(Cost.DetachFromSelf(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)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(1-tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function s.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsMonster()
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(s.cfilter,nil)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Main Phase (Quick Effect): You can Tribute 1 other Level 7 or higher monster from your hand; Special Summon this card from your hand, also you cannot Special Summon for the rest of this turn, except monsters with a Level. If this card is Special Summoned: You can add 1 "Ursarctic" monster from your Deck to your hand, except "Ursarctic Mikpolar". You can only use each effect of "Ursarctic Mikpolar" once per turn.
|
--ベアルクティ-ミクポーラ
--Ursarctic Mikpolar
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--special summon
c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id))
--to hand
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_DELAY)
e2:SetCountLimit(1,{id,1})
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_series={SET_URSARCTIC}
function s.thfilter(c)
return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Neither player can Tribute cards.
|
--生贄封じの仮面
--Mask of Restrict
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot release
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_RELEASE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
1 Tuner + 1 or more non-Tuner "Gusto" monsters When this card is Synchro Summoned: You can target 1 "Gusto" card in your Graveyard; add that target to your hand. Your opponent takes any Battle Damage you would have taken from battles involving a face-up "Gusto" monster you control. This card cannot be destroyed by battle.
|
--ダイガスタ・スフィアード
--Daigusto Sphreez
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsSetCard,SET_GUSTO),1,99)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--reflect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e2:SetTarget(s.reftg)
e2:SetValue(1)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
end
s.listed_series={SET_GUSTO}
function s.reftg(e,c)
return c:IsSetCard(SET_GUSTO)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSynchroSummoned()
end
function s.filter(c)
return c:IsSetCard(SET_GUSTO) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Once per Chain, when a card or effect is activated (Quick Effect): You can target 1 "Mist Valley" card you control; return that target to the hand, and if you do, negate the activation, and if you do that, destroy it.
|
--霞の谷の巨神鳥
--Mist Valley Apex Avian
local s,id=GetID()
function s.initial_effect(c)
--Negate the activation of a card or effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(function(e) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) end)
e1:SetTarget(s.negtg)
e1:SetOperation(s.negop)
c:RegisterEffect(e1)
end
s.listed_series={SET_MIST_VALLEY}
function s.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_MIST_VALLEY) and c:IsAbleToHand()
end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
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.negop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and tc:IsSetCard(SET_MIST_VALLEY)
and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND)
and 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:
|
When this card is Special Summoned by the effect of a "Gladiator Beast" monster: Target 1 face-down Spell or Trap Card in the Spell & Trap Card Zone; destroy that target. At the end of your Battle Phase, if this card attacked or was attacked: Shuffle this card into the Deck or discard 1 card.
|
--剣闘獣オクタビウス
--Gladiator Beast Octavius
local s,id=GetID()
function s.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(aux.gbspcon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--discard or return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_HANDES+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE|PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.dcon)
e2:SetTarget(s.dtg)
e2:SetOperation(s.dop)
c:RegisterEffect(e2)
end
function s.desfilter(c)
return c:IsFacedown() and c:GetSequence()~=5
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.dcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0 and Duel.IsTurnPlayer(tp)
end
function s.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(id+1)==0 end
e:GetHandler():RegisterFlagEffect(id+1,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE,EFFECT_FLAG_OATH,1)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,0)
end
function s.dop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT|REASON_DISCARD)
else
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Activate only when an opponent's monster declares an attack. Negate the battle, and 1 monster with the lowest ATK in face-up Attack Position your opponent controls battles against 1 monster with the lowest DEF in face-up Defense Position you control. After that battle, end the Battle Phase.
|
--スーパージュニア対決!
--Super Junior Confrontation
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsPosition,tp,LOCATION_MZONE,0,1,nil,POS_FACEUP_DEFENSE) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_FACEUP_ATTACK)
local g2=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE)
if #g1==0 or #g2==0 then return end
local ga=g1:GetMinGroup(Card.GetAttack)
local gd=g2:GetMinGroup(Card.GetDefense)
if #ga>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,0))
ga=ga:Select(tp,1,1,nil)
end
if #gd>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
gd=gd:Select(tp,1,1,nil)
end
Duel.NegateAttack()
local a=ga:GetFirst()
local d=gd:GetFirst()
if a:CanAttack() and not a:IsImmuneToEffect(e) and not d:IsImmuneToEffect(e) then
Duel.CalculateDamage(a,d)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE|PHASE_BATTLE_STEP,1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Each time a Quick-Play Spell Card activates: Banish the top card of your opponent's Deck. You can only control 1 "Runick Allure".
|
--神碑の誑かし
--Runick Allure
--Scripted by Larry126
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Banish the top card of your opponent's Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
end
s.listed_names={id}
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsSpellEffect() and re:GetHandler():IsType(TYPE_QUICKPLAY) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(1-tp,1)
if #g==0 then return end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can discard this card; add to your hand, 1 of your "Thunder Dragon" cards that is banished or in your GY, except "Thunder Dragonroar". If this card is banished, or sent from the field to the GY: You can Special Summon 1 "Thunder Dragon" monster from your Deck in Defense Position, but return it to the hand during the End Phase. You can only use 1 "Thunder Dragonroar" effect per turn, and only once that turn.
|
--雷獣龍-サンダー・ドラゴン
--Thunder Dragonroar
--scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Add to your hand, 1 of your "Thunder Dragon" cards that is banished or in your GY, except "Thunder Dragonroar"
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Special Summon 1 "Thunder Dragon" monster from your Deck in Defense Position, but return it to the hand during the End Phase
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end)
c:RegisterEffect(e3)
end
s.listed_series={SET_THUNDER_DRAGON}
s.listed_names={id}
function s.thfilter(c)
return c:IsSetCard(SET_THUNDER_DRAGON) and c:IsAbleToHand() and not c:IsCode(id)
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_THUNDER_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(ag) Duel.SendtoHand(ag,nil,REASON_EFFECT) end,nil,0)
end
Duel.SpecialSummonComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Each player gains 1000 LP, then you can apply the following effect. ● Discard 1 card, and if you do, Special Summon 1 Level 1 "Purrely" monster from your Deck. A "Purrely" Xyz Monster that has this card as material gains the following effect. ● Once per turn: You can send 1 other card you control to the GY, then target 1 card your opponent controls; attach it to this card as material.
|
--ピュアリィ・プリティメモリー
--Purrely Pretty Memory
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Each player gains 1000 LP, discard 1 card and Special Summon 1 "Purrely" monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_HANDES+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Provide an effect to a "Purrely" Xyz monster with this card as material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(function(e) return e:GetHandler():IsSetCard(SET_PURRELY) end)
e2:SetCost(s.atchcost)
e2:SetTarget(s.atchtg)
e2:SetOperation(s.atchop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PURRELY}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,1000)
Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_PURRELY) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,1000,REASON_EFFECT)==0 or Duel.Recover(1-tp,1000,REASON_EFFECT)==0 then return end
--Discard 1 card and Special Summon 1 "Purrely" monster from the Deck
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT|REASON_DISCARD,nil)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function s.atchcostfilter(c,tp)
return c:IsAbleToGraveAsCost() and Duel.IsExistingTarget(s.atchfilter,tp,0,LOCATION_ONFIELD,1,c:GetEquipGroup()+c)
end
function s.atchfilter(c)
return not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler()
end
function s.atchcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.atchcostfilter,tp,LOCATION_ONFIELD,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.atchcostfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.atchtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and s.atchfilter(chkc) end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(s.atchfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.atchfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function s.atchop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
tc:CancelToGrave()
Duel.Overlay(c,tc,true)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card is in your hand, field, or GY: You can target 1 "Springans" Xyz Monster you control; attach this card to it as material. During your opponent's turn (Quick Effect): You can detach 1 material from a monster you control, then target 1 face-up card on the field; destroy it. You can only use each of the previous effects of "Springans Captain Sargas" once per turn. A "Springans" Xyz Monster that has this card as material gains this effect. ● This card gains 500 ATK. * The above text is unofficial and describes the card's functionality in the OCG.
|
--スプリガンズ・キャプテン サルガス
--Springans Captain Sargas
--Logical Nonsense
--Substitute ID
local s,id=GetID()
function s.initial_effect(c)
--Attach itself to 1 "Sprigguns" Xyz monster from hand, field, or GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE|LOCATION_HAND|LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.mattg)
e1:SetOperation(s.matop)
c:RegisterEffect(e1)
--Destroy 1 face-up card on the field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,{id,1})
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.descon)
e2:SetCost(s.cost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
e2:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e2)
--A "Sprigguns" Xyz monster with this card as material gains 500 ATK
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_XMATERIAL)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCondition(s.xyzcon)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
c:RegisterEffect(e3)
end
--Lists "Sprigguns" archetype
s.listed_series={SET_SPRINGANS}
--Check for "Sprigguns" Xyz monster
function s.matfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_SPRINGANS) and c:IsType(TYPE_XYZ)
end
--Activation legality
function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.matfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
if(e:GetHandler():IsLocation(LOCATION_GRAVE)) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
end
--Attach itself to targeted "Sprigguns" Xyz monster from hand, field, or GY
function s.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,c)
end
end
--Check if it's opponent's turn
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
--Detach 1 Xyz material from your field as cost
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
--Activation legality
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
--Destroy targeted card
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--Check if Xyz monster this card is attached to is "Spriggun" card
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSetCard(SET_SPRINGANS)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can target 1 card you control and 1 card your opponent controls; destroy them, and if you destroyed a face-up Fiend monster(s) by this effect, this card gains ATK equal to half the Fiend monster(s)'s original ATK, until the end of this turn. You can only use this effect of "Annihilator Archfiend" once per turn.
|
--ディザスター・デーモン
--Annihilator Archfiend
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Destroy 1 card from each side of the field
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
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(nil,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function s.filter(c)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_FIEND==RACE_FIEND
and c:IsPreviousLocation(LOCATION_MZONE)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTargetCards(e)
if #g>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local sg=Duel.GetOperatedGroup():Filter(s.filter,nil)
if #sg>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=sg:GetSum(Card.GetBaseAttack)/2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Equip only to "Elemental HERO Wildheart". It gains 500 ATK. When the equipped monster is destroyed by a card effect and sent to the Graveyard: Destroy all Spell and Trap Cards on the field, then inflict 100 damage to your opponent for each Spell/Trap Card destroyed by this effect.
|
--サイクロン・ブーメラン
--Cyclone Boomerang
local s,id=GetID()
function s.initial_effect(c)
aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsCode,86188410))
--equip effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
s.listed_names={86188410}
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetPreviousEquipTarget()
return e:GetHandler():IsReason(REASON_LOST_TARGET) and ec:IsLocation(LOCATION_GRAVE)
and (ec:GetReason()&(REASON_DESTROY|REASON_EFFECT))==(REASON_DESTROY|REASON_EFFECT)
end
function s.dfilter(c)
return c:IsSpellTrap()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,#g*100)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local ct=Duel.Destroy(g,REASON_EFFECT)
Duel.Damage(1-tp,ct*100,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a monster that was Special Summoned this turn activates its effect on your opponent's field: Negate that effect, and if you do, destroy that card.
|
--蟲惑の落とし穴
--Traptrix Trap Hole Nightmare
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local loc,status,controller=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_STATUS,CHAININFO_TRIGGERING_CONTROLER)
return controller==1-tp and status&STATUS_SPSUMMON_TURN>0 and loc==LOCATION_MZONE and Duel.IsChainDisablable(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_DISABLE,eg,1,0,0)
local rc=re:GetHandler()
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(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:
|
Discard 1 card from your hand during your Main Phase 1. This monster can attack twice during the Battle Phase of this turn.
|
--グレイ・ウイング
--Gray Wing
local s,id=GetID()
function s.initial_effect(c)
--multiatk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.atkcon)
e1:SetCost(s.atkcost)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent activates a Spell/Trap Card while you control a "Magical Musket" monster: Negate the activation, and if you do, destroy that card. You can only activate 1 "Magical Musket - Last Stand" per turn.
|
--魔弾-デッドマンズ・バースト
--Magical Musket - Last Stand
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_MAGICAL_MUSKET}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MAGICAL_MUSKET),tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
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:
|
Once per turn, during your Main Phase: You can discard 1 monster; add 1 "Mirror Force" from your Deck or GY to your hand. If this Set card is destroyed by your opponent's card effect and sent to your GY: You can Set this card from your GY and 1 "Mirror Force" from your hand, Deck, or GY. They can be activated this turn.
|
--ミラーフォース・ランチャー
--Mirror Force Launcher
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Set 1 "Mirror Force"
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.thcon)
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--Set itself and 1 "Mirror Force"
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.setcon)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end
s.listed_names={44095762} --Mirror Force
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp) and Duel.IsMainPhase()
end
function s.thcfilter(c)
return c:IsMonster() and c:IsDiscardable()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.thcfilter,1,1,REASON_COST|REASON_DISCARD)
end
function s.thfilter(c)
return c:IsCode(44095762) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil)
and e:GetHandler():GetFlagEffect(id)==0 end
e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.setfilter(c)
return c:IsCode(44095762) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>1 and c:IsSSetable()
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 or not c:IsRelateToEffect(e) or not c:IsSSetable() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local sg=Group.FromCards(c,tc)
Duel.SSet(tp,sg)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can activate 1 of these effects; ● Add 1 face-up "Solfachord" Pendulum Monster from your Extra Deck to your hand. ● Increase the Pendulum Scale of 1 "Solfachord" card in your Pendulum Zone by its Level this turn. ● If you control "Solfachord" Pendulum Monster Cards with at least 3 different even Pendulum Scales or at least 3 different odd Pendulum Scales, destroy 1 card your opponent controls. You can only use each effect of "Solfachord Harmonia" once per turn.
|
--ドレミコード・ハルモニア
--Solfachord Harmonia
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(s.target)
c:RegisterEffect(e2)
end
s.listed_series={SET_SOLFACHORD}
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=s.thtg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=s.pentg(e,tp,eg,ep,ev,re,r,rp,0)
local b3=s.destg(e,tp,eg,ep,ev,re,r,rp,0)
if chk==0 then return b1 or b2 or b3 end
local ops={}
local opval={}
local off=1
if b1 then
ops[off]=aux.Stringid(id,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(id,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(id,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
if sel==1 then
e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(s.thop)
s.thtg(e,tp,eg,ep,ev,re,r,rp,1)
elseif sel==2 then
e:SetOperation(s.penop)
s.pentg(e,tp,eg,ep,ev,re,r,rp,1)
elseif sel==3 then
e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(s.desop)
s.destg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(0)
e:SetOperation(nil)
end
end
function s.thfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_SOLFACHORD) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.penfilter(c)
return c:IsSetCard(SET_SOLFACHORD) and c:GetOriginalLevel()>0
end
function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id+1)==0 and Duel.IsExistingMatchingCard(s.penfilter,tp,LOCATION_PZONE,0,1,nil) end
Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE|PHASE_END,0,1)
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectMatchingCard(tp,s.penfilter,tp,LOCATION_PZONE,0,1,1,nil):GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(tc:GetOriginalLevel())
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
end
end
function s.descfilter(c,f)
return c:IsFaceup() and c:IsSetCard(SET_SOLFACHORD) and c:IsOriginalType(TYPE_PENDULUM) and c:IsOriginalType(TYPE_MONSTER) and f(c)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then
local pg1=Duel.GetMatchingGroup(s.descfilter,tp,LOCATION_ONFIELD,0,nil,Card.IsOddScale)
local pg2=Duel.GetMatchingGroup(s.descfilter,tp,LOCATION_ONFIELD,0,nil,Card.IsEvenScale)
return Duel.GetFlagEffect(tp,id+2)==0 and #g>0 and
(pg1:GetClassCount(Card.GetLeftScale)>=3 or pg2:GetClassCount(Card.GetLeftScale)>=3
or pg1:GetClassCount(Card.GetRightScale)>=3 or pg2:GetClassCount(Card.GetRightScale)>=3)
end
Duel.RegisterFlagEffect(tp,id+2,RESET_PHASE|PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
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 GY: You can pay 1500 LP; look at your opponent's hand, then add 1 monster from their hand to your hand.
|
--アマゾネスの鎖使い
--Amazoness Chain Master
local s,id=GetID()
function s.initial_effect(c)
--get card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(s.condition)
e1:SetCost(Cost.PayLP(1500))
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if #g>0 then
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsMonster,nil)
if #tg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=tg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When a monster declares an attack: Tribute 1 "Orcust" or "World Legacy" monster, then target 1 monster your opponent controls; banish it.
|
--オルフェゴール・アタック
--Orcustrated Attack
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_ORCUST,SET_WORLD_LEGACY}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function s.spcheck(sg,tp,exg,dg)
return dg:IsExists(aux.TRUE,1,sg)
end
function s.cfilter(c)
return c:IsSetCard({SET_ORCUST,SET_WORLD_LEGACY})
end
function s.filter(c,e)
return c:IsAbleToRemove() and c:IsCanBeEffectTarget(e)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
local dg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil,e)
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,s.spcheck,nil,dg)
else
return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,s.spcheck,nil,dg)
Duel.Release(sg,REASON_COST)
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.activate(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
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
2 Level 5 monsters Once per turn: You can detach 1 Xyz Material from this card, then target 1 face-up monster your opponent controls; destroy that opponent's monster, and if you do, inflict damage to your opponent equal to the destroyed monster's original ATK. This card cannot attack your opponent directly during the turn you activate this effect.
|
--No.61 ヴォルカザウルス
--Number 61: Volcasaurus
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure: 2 Level 5 monsters
Xyz.AddProcedure(c,nil,5,2)
--Destroy 1 face-up monster your opponent controls, and if you do, inflict damage to your opponent equal to the destroyed monster's original ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.descost))
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
s.xyz_number=61
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsDirectAttacked() end
--This card cannot attack your opponent directly the turn you activate this effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(3207)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
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 tc=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsMonster() and tc:IsControler(1-tp) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card you control is destroyed by battle with an opponent's attacking monster and sent to your Graveyard: You can Special Summon 1 Spellcaster-Type monster with 1500 or less ATK from your Deck in Attack Position.
|
--魔装戦士 アルニス
--Arnis, the Empowered Warrior
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
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and Duel.GetAttacker():IsControler(1-tp)
end
function s.filter(c,e,tp)
return c:IsAttackBelow(1500) and c:IsRace(RACE_SPELLCASTER) 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_ATTACK)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When this card is Normal Summoned: You can target 1 other Cyberse monster you control; while this face-up monster is on the field, that monster gains 800 ATK. If this card in the Monster Zone is destroyed by a card effect and sent to the GY: Each player takes 800 damage. You can only use this effect of "Capacitor Stalker" once per turn.
|
--コンデンサー・デスストーカー
--Capacitor Stalker
local s,id=GetID()
function s.initial_effect(c)
--1 other Cyberse monster you control gains 800 ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--Each player takes 800 damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsRace(RACE_CYBERSE) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,1,1,c)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
--That monster gains 800 ATK while this monster is face-up on the field
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(function(e,_c) return c:IsHasCardTarget(_c) end)
e1:SetValue(800)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_MZONE)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,800)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,800,REASON_EFFECT,true)
Duel.Damage(1-tp,800,REASON_EFFECT,true)
Duel.RDComplete()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Special Summon this card (from your hand) by Tributing 1 Machine monster. Once per turn, during your Main Phase: You can Fusion Summon 1 Machine Fusion Monster from your Extra Deck, using monsters from your hand and/or field as material. When a Fusion Monster you control is destroyed by battle: You can banish this card from your GY; add 1 "Power Bond" from your Deck to your hand. You can only use this effect of "Cyber Pharos" once per turn.
|
--サイバー・ファロス
--Cyber Pharos
local s,id=GetID()
function s.initial_effect(c)
--Special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon1)
e1:SetTarget(s.sptg1)
e1:SetOperation(s.spop1)
c:RegisterEffect(e1)
--Fusion summon
local params = {aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE)}
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(Fusion.SummonEffTG(table.unpack(params)))
e2:SetOperation(Fusion.SummonEffOP(table.unpack(params)))
c:RegisterEffect(e2)
--Search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,id)
e3:SetCost(Cost.SelfBanish)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
s.listed_names={37630732}
function s.spcon1(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsRace,1,false,1,true,c,c:GetControler(),nil,false,e:GetHandler(),RACE_MACHINE)
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,false,true,true,c,nil,nil,false,e:GetHandler(),RACE_MACHINE)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
end
return false
end
function s.spop1(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.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsType(TYPE_FUSION) and c:IsReason(REASON_BATTLE)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.thfilter(c)
return c:IsCode(37630732) 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:
|
Each player can Special Summon a maximum of 3 monsters from the Extra Deck each turn.
|
--サモン・ゲート
--Summon Gate
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)
--summon count limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(s.sumlimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(CARD_SUMMON_GATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(s.remainval)
c:RegisterEffect(e3)
aux.GlobalCheck(s,function()
s[0]=3
s[1]=3
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
aux.AddValuesReset(function()
s[0]=3
s[1]=3
end)
end)
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and s[sump]<=0
end
function s.remainval(sump)
return math.max(s[sump],0)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
for tc in aux.Next(eg) do
if tc:IsPreviousLocation(LOCATION_EXTRA) then
local p=tc:GetSummonPlayer()
s[p]=s[p]-1
end
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can Special Summon this card (from your hand) to your opponent's field in Attack Position, by Tributing 1 monster they control. If your opponent controls a "Kaiju" monster, you can Special Summon this card (from your hand) in Attack Position. You can only control 1 "Kaiju" monster. When your opponent Normal or Special Summons a monster(s) (except during the Damage Step): You can remove 2 Kaiju Counters from anywhere on the field; until the end of the next turn, that monster(s) cannot attack and its effects are negated.
|
--粘糸壊獣クモグス
--Kumongous, the Sticky String Kaiju
local s,id=GetID()
function s.initial_effect(c)
local e1,e2=aux.AddKaijuProcedure(c)
--When opponent normal or special summons a monster(s), negate its effect also it cannot attack
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
s.counter_list={COUNTER_KAIJU}
function s.filter(c,tp)
return c:IsSummonPlayer(tp) and c:IsFaceup()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,COUNTER_KAIJU,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,COUNTER_KAIJU,2,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter,1,nil,1-tp) and not eg:IsContains(e:GetHandler()) end
local g=eg:Filter(s.filter,nil,1-tp)
Duel.SetTargetCard(g)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTargetCards(e)
local tc=g:GetFirst()
for tc in aux.Next(g) do
--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(RESETS_STANDARD_PHASE_END,2)
tc:RegisterEffect(e1)
--Negate their effects
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESETS_STANDARD_PHASE_END,2)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESETS_STANDARD_PHASE_END,2)
tc:RegisterEffect(e3)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Discard 2 cards from your hand. Negate the activation of a Spell Card and destroy it. Also, look at your opponent's hand and Deck and if you find any Spell Cards of the same name as the destroyed Spell Card, send all of them to the Graveyard.
|
--呪術抹消
--Spell Vanishing
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST|REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND|LOCATION_DECK)>0 end
local rc=re:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND|LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND|LOCATION_DECK)
if #g==0 then return end
Duel.BreakEffect()
Duel.ConfirmCards(tp,g)
local sg=g:Filter(Card.IsCode,nil,rc:GetCode())
if #sg>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
Duel.ShuffleDeck(1-tp)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can activate 1 Trap Card the turn it was Set. You can send 1 "Mystical Beast of Serket" in your Monster Zone and this card you control to the Graveyard; Special Summon 1 monster from your hand or Deck, or 1 Fusion Monster from your Extra Deck. You can only use each effect of "Temple of the Kings" once per turn.
|
--王家の神殿
--Temple of the Kings
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)
--Allow 1 Trap card to be activated the turn it was Set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_SZONE,0)
e2:SetCountLimit(1,id)
c:RegisterEffect(e2)
--Special Summon 1 monster from the hand, Deck or Extra Deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,{id,1})
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
end
s.listed_names={89194033}
function s.cfilter(c,e,tp,rp)
if c:IsFacedown() or not c:IsCode(89194033) or not c:IsAbleToGraveAsCost() then return false end
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_HAND|LOCATION_EXTRA,0,1,nil,e,tp,rp,Group.FromCards(c,e:GetHandler()))
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp,rp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp,rp)
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function s.filter(c,e,tp,rp,sg)
if not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return false end
if c:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
else
return c:IsType(TYPE_FUSION) and Duel.GetLocationCountFromEx(tp,rp,sg,c)>0
end
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND|LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK|LOCATION_HAND|LOCATION_EXTRA,0,1,1,nil,e,tp,rp)
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:
|
1 "Watt" Tuner + 1 or more non-Tuner Thunder-Type monsters This card can attack your opponent directly. When this card inflicts Battle Damage to your opponent by a direct attack, choose 1 card in your Deck and remove it from play. Add that card to your hand during your 2nd Standby Phase after activating this effect.
|
--エレキリム
--Watthydra
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_WATT),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_THUNDER),1,99)
c:EnableReviveLimit()
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--handes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(s.condition)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
s.listed_series={SET_WATT}
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if tg==nil then return end
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,2)
e1:SetCondition(s.thcon)
e1:SetOperation(s.thop)
e1:SetLabel(0)
tg:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
if ct==1 then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
else e:SetLabel(1) end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Each face-up monster on the field loses 2 Levels, until the End Phase. You can remove from play this card from your Graveyard to select 1 face-up monster, and reduce its Level by 1, until the End Phase. This effect cannot be activated the turn this card is sent to the Graveyard.
|
--妖怪のいたずら
--Mischief of the Yokai
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,TIMINGS_CHECK_MONSTER)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--lvdown
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsFaceup() and c:IsLevelAbove(2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in g:Iter() do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-2)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-1)
e1:SetReset(RESETS_STANDARD_PHASE_END)
tc:RegisterEffect(e1)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 2 "Dark World" monsters in your GY; add those targets to your hand.
|
--暗黒よりの軍勢
--The Forces of Darkness
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_DARK_WORLD}
function s.filter(c)
return c:IsSetCard(SET_DARK_WORLD) and c:IsMonster() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If this card in your Monster Zone is destroyed by battle or monster effect and sent to your Graveyard: You can target 1 face-up monster your opponent controls; equip this card to that target. While this card is equipped to a monster by this effect, take control of that monster. When this card leaves the field, destroy the equipped monster.
|
--グレイドル・イーグル
--Graydle Eagle
local s,id=GetID()
function s.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and re and re:IsMonsterEffect()))
and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.CheckStealEquip(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(aux.CheckStealEquip,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,aux.CheckStealEquip,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and aux.CheckStealEquip(tc,e,tp) and Duel.Equip(tp,c,tc,true) then
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_SET_CONTROL)
e2:SetValue(tp)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetOperation(s.checkop)
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetOperation(s.desop)
e4:SetReset(RESET_EVENT|RESET_OVERLAY|RESET_TOFIELD)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
if e:GetLabelObject():GetLabel()~=0 then return end
local tc=e:GetHandler():GetEquipTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can target 1 face-up card you control; you cannot Special Summon monsters from the Extra Deck for the rest of this turn, except Machine-Type Synchro Monsters, also, destroy that card, and if you do, Special Summon 1 "Crystron" Tuner from your Deck. You can banish this card from your Graveyard; add 1 "Crystron" monster from your Deck to your hand, except "Crystron Thystvern". You can only use 1 "Crystron Thystvern" effect per turn, and only once that turn.
|
--水晶機巧-シストバーン
--Crystron Thystvern
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_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(Cost.SelfBanish)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
s.listed_series={SET_CRYSTRON}
s.listed_names={id}
function s.desfilter(c,ft)
return c:IsFaceup() and (ft>0 or (c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5))
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_CRYSTRON) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.desfilter(chkc,ft) end
if chk==0 then
return ft>-1 and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,ft)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(aux.Stringid(id,2))
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
--lizard check
aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter)
end
function s.splimit(e,c)
return not (c:IsRace(RACE_MACHINE) and c:IsType(TYPE_SYNCHRO)) and c:IsLocation(LOCATION_EXTRA)
end
function s.lizfilter(e,c)
return not (c:IsOriginalRace(RACE_MACHINE) and c:IsOriginalType(TYPE_SYNCHRO))
end
function s.thfilter(c)
return c:IsSetCard(SET_CRYSTRON) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Special Summon 3 "Ojama Tokens" (Beast-Type/LIGHT/Level 2/ATK 0/DEF 1000) to your opponent's field in Defense Position. They cannot be Tributed for a Tribute Summon, and each time 1 is destroyed, its controller takes 300 damage.
|
--おジャマトリオ
--Ojama Trio
local s,id=GetID()
function s.initial_effect(c)
--Special summon 3 tokens to opponent's field
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
end
s.listed_names={TOKEN_OJAMA}
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,tp)>2
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_OJAMA,SET_OJAMA,TYPES_TOKEN,0,1000,2,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENSE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,0,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,tp)<3
or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_OJAMA,SET_OJAMA,TYPES_TOKEN,0,1000,2,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENSE,1-tp) then return end
for i=0,2 do
local token=Duel.CreateToken(tp,TOKEN_OJAMA+i)
if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) then
--Cannot be tributed for a tribute summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(3304)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
--Inflict 300 damage when destroyed
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(s.damop)
token:RegisterEffect(e2,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(),300,REASON_EFFECT)
end
e:Reset()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Shuffle 1 "/Assault Mode" monster from your hand into the Deck; draw 2 cards.
|
--バスター・テレポート
--Assault Teleport
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1: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
s.listed_series={SET_ASSAULT_MODE}
function s.filter(c)
return c:IsSetCard(SET_ASSAULT_MODE) and c:IsAbleToDeck()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Target 1 "Amazement" monster you control or 1 face-up monster your opponent controls; equip this card to it. Apply the appropriate effect, based on which player controls the equipped monster. ● You: The equipped monster gains 500 ATK. If it would be destroyed by battle or card effect, you can send this card to the GY instead. ● Your opponent: The equipped monster loses 500 ATK for each of your "Attraction" Traps equipped to a monster(s). * The above text is unofficial and describes the card's functionality in the OCG.
|
--A・Ɐ・MM
--Amaze Attraction Majestic Merry-Go-Round
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--From cards_specific_functions.lua
aux.AddAttractionEquipProc(c)
--You: The equipped monster gains 500 ATK, also if it would be destroyed by battle or card effect, you can send this card to the GY instead.
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
--Your opponent: The equipped monster loses 500 ATK for each of your "Ɐttraction" Traps that are equipped to a monster.
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(s.desreptg)
c:RegisterEffect(e3)
end
s.listed_series={SET_AMAZEMENT,SET_ATTRACTION}
function s.atkfilter(c)
return c:IsTrap() and c:IsSetCard(SET_ATTRACTION) and c:GetEquipTarget()
end
function s.atkval(e,c)
local et=e:GetHandler():GetEquipTarget()
local hp=e:GetHandlerPlayer()
if not et then return 0 end
if et:GetControler()==hp then
return 500
else
return Duel.GetMatchingGroupCount(s.atkfilter,hp,LOCATION_SZONE,0,nil)*-500
end
end
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if chk==0 then return tc:IsControler(tp) and not tc:IsReason(REASON_REPLACE) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.SendtoGrave(c,REASON_EFFECT)
return true
else return false end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Tribute 1 DARK monster with 1500 or more ATK; destroy all monsters that were Special Summoned this turn.
|
--闇の閃光
--Darklight
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,TIMINGS_CHECK_MONSTER_E)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function s.costfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackAbove(1500)
and Duel.IsExistingMatchingCard(s.dfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function s.dfilter(c)
return c:IsStatus(STATUS_SPSUMMON_TURN)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=0 then
e:SetLabel(0)
return Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil)
else
return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local rg=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil)
Duel.Release(rg,REASON_COST)
end
local g=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
Add 1 "Ryu-Ge" monster from your Deck to your hand, then you can add 1 "Ryu-Ge" Pendulum Monster from your hand to your face-up Extra Deck. During your Main Phase, if you control a "Ryu-Ge" Pendulum Monster Card: You can banish this card and 1 "Ryu-Ge" monster from your GY; Special Summon 1 "Ryu-Ge" monster with the same original Type as that banished monster from your Deck. You can only use 1 "Ryu-Ge Rising" effect per turn, and only once that turn.
|
--竜華界闢
--Ryu-Ge Rising
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Add 1 "Ryu-Ge" monster from your Deck to your hand, then you can add 1 "Ryu-Ge" Pendulum Monster from your hand to your Extra Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOEXTRA)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--Special Summon 1 "Ryu-Ge" monster from your Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
s.listed_series={SET_RYU_GE}
function s.thfilter(c)
return c:IsSetCard(SET_RYU_GE) and c:IsMonster() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_HAND)
end
function s.tedfilter(c)
return c:IsSetCard(SET_RYU_GE) and c:IsType(TYPE_PENDULUM)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
if Duel.IsExistingMatchingCard(s.tedfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3))
local g=Duel.SelectMatchingCard(tp,s.tedfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoExtraP(g,tp,REASON_EFFECT)
end
end
end
end
function s.spconfilter(c)
return c:IsSetCard(SET_RYU_GE) and c:IsOriginalType(TYPE_PENDULUM) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.spcostfilter(c,e,tp)
return c:IsSetCard(SET_RYU_GE) and c:IsMonster() and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalRace())
end
function s.spfilter(c,e,tp,race)
return c:IsSetCard(SET_RYU_GE) and c:IsOriginalRace(race) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetOriginalRace())
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
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,e:GetLabel())
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:
|
Before damage calculation, if your Wyrm monster battles an opponent's monster that was Special Summoned from the Extra Deck: You can destroy both that opponent's monster and this card. You can only use each of the following effects of "Swordsoul Auspice Chunjun" once per turn. During the Main Phase (Quick Effect): You can Tribute 1 monster; Special Summon this card from your hand. If this card is sent to the GY as Synchro Material: You can target 1 card on the field or in either GY; banish it.
|
--相剣瑞獣-純鈞
--Swordsoul Auspice Chunjun
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Destroy itself and an opponent's monster that battles your Wyrm monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--Special Summon itself from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e2:SetCountLimit(1,id)
e2:SetCondition(function() return Duel.IsMainPhase() end)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Banish 1 card from the field or GY
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
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 a,b=Duel.GetAttacker(),Duel.GetAttackTarget()
if a:IsControler(1-tp) then a,b=b,a end
if chk==0 then return a and a:IsRace(RACE_WYRM) and b and b:IsControler(1-tp)
and b:IsSummonLocation(LOCATION_EXTRA) end
local g=Group.FromCards(e:GetHandler(),b)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local a,b=Duel.GetAttacker(),Duel.GetAttackTarget()
if a:IsStatus(STATUS_ATTACK_CANCELED) then return end
if a:IsControler(1-tp) then a,b=b,a end
if a and a:IsRelateToBattle() and b and b:IsRelateToBattle() and b:IsControler(1-tp) then
local g=Group.FromCards(c,b)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,aux.ReleaseCheckMMZ,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,aux.ReleaseCheckMMZ,nil)
Duel.Release(g,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_HAND)
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.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD|LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD|LOCATION_GRAVE,LOCATION_ONFIELD|LOCATION_GRAVE,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
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
If you Ritual Summon exactly 1 WATER Ritual Monster with a card effect that requires use of monsters, this card can be used as the entire requirement. You can discard this card; add 1 "Gishki" Ritual Spell Card from your Deck to your hand.
|
--シャドウ・リチュア
--Gishki Shadow
local s,id=GetID()
function s.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--ritual level
Ritual.AddWholeLevelTribute(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER))
end
s.listed_series={SET_GISHKI}
function s.filter(c)
return c:IsSetCard(SET_GISHKI) and c:IsRitualSpell() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp,chk)
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 your opponent controls more monsters than you do, you can Normal Summon this card without Tributing. If this card is Tributed: You can Special Summon 1 "Black Luster Soldier" monster from your hand or Graveyard. You can only use this effect of "Arisen Gaia the Fierce Knight" once per turn. When you Ritual Summon a "Black Luster Soldier" monster, you can banish this card from your Graveyard as 1 of the monsters required for the Ritual Summon.
|
--覚醒の暗黒騎士ガイア
--Arisen Gaia the Fierce Knight
local s,id=GetID()
function s.initial_effect(c)
--Can be Normal Summoned with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
c:RegisterEffect(e1)
--Special Summon 1 "Black Lust Soldier" monster from the hand or GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--Can be used for a Ritual Summoned while in the GY
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(s.mtcon)
e3:SetValue(s.mtval)
c:RegisterEffect(e3)
end
s.listed_series={SET_BLACK_LUSTER_SOLDIER}
function s.ntcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_BLACK_LUSTER_SOLDIER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.mtcon(e)
return not Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),CARD_SPIRIT_ELIMINATION)
end
function s.mtval(e,c)
return c:IsSetCard(SET_BLACK_LUSTER_SOLDIER)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During your Main Phase: You can activate this effect; discard 1 "Fabled" monster, and if you do, Special Summon this card from your hand.
|
--魔轟神獣チャワ
--The Fabled Chawa
local s,id=GetID()
function s.initial_effect(c)
--Special Summon itself from the hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
s.listed_series={SET_FABLED}
function s.disfilter(c)
return c:IsSetCard(SET_FABLED) and c:IsMonster() and c:IsDiscardable()
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.disfilter,tp,LOCATION_HAND,0,1,e:GetHandler())
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 g=Duel.GetMatchingGroup(s.disfilter,tp,LOCATION_HAND,0,nil)
if #g==0 then return end
if #g==1 then
Duel.SendtoGrave(g,REASON_EFFECT|REASON_DISCARD)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=g:Select(tp,1,1,e:GetHandler())
Duel.SendtoGrave(sg,REASON_EFFECT|REASON_DISCARD)
end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
During the Main Phase (Quick Effect): You can discard this card; banish 1 "Kaiju" monster you control that is owned by your opponent, then, you can Special Summon 1 monster from your GY. You can only control 1 "Kaiju" monster. This card is unaffected by other "Kaiju" cards' effects, also it cannot be destroyed by battle with a "Kaiju" monster. During your End Phase, if this card is in your GY: You can Special Summon this card. You can only use this effect of "Super Anti-Kaiju War Machine Mecha-Thunder-King" once per Duel.
|
--対壊獣用決戦兵器メカサンダー・キング
--Super Anti-Kaiju War Machine Mecha-Thunder-King
local s,id=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,SET_KAIJU),LOCATION_MZONE)
--Banish 1 "Kaiju" monster and Special Summon 1 monster from the GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(s.spcon)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Cannot be destroyed by battle with a "Kaiju" monster
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(function (e,c) return c:IsSetCard(SET_KAIJU) end)
c:RegisterEffect(e2)
--Unnaffected by other "Kaiju" cards' effects
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(s.efilter)
c:RegisterEffect(e3)
--Special Summon itself from the GY
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL)
e4:SetCondition(s.spcond2)
e4:SetTarget(s.sptg2)
e4:SetOperation(s.spop2)
c:RegisterEffect(e4)
end
s.listed_series={SET_KAIJU}
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.rmfilter(c,e)
return c:IsFaceup() and c:IsSetCard(SET_KAIJU) and c:IsAbleToRemove() and c:GetOwner()~=e:GetHandler():GetControler()
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,0,1,nil,e) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,e):GetFirst()
if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 then
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end
end
end
end
function s.efilter(e,te)
return te:GetHandler():IsSetCard(SET_KAIJU)
end
function s.spcond2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
You can discard 1 other LIGHT or DARK monster; Special Summon this card from your hand. You can target 1 monster in either GY; equip it to this card as an Equip Spell, and if you do, this card's name becomes that equipped monster's name (until the End Phase), then if you equipped a LIGHT or DARK Monster Card by this effect, you can Special Summon 1 DARK "Allure Queen" monster from your Deck or GY. You can only use each effect of "Chaos Allure Queen" once per turn.
|
--混沌なる魅惑の女王
--Chaos Allure Queen
--scripted by pyrQ
local s,id=GetID()
function s.initial_effect(c)
--Special Summon this card from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Equip 1 monster from either GY to this card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.eqconignition)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
aux.AddEREquipLimit(c,s.eqconignition,s.eqval,s.equipop,e2)
--Quick Effect version for when the effect of "Golden Allure Queen" is applied
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(TIMING_STANDBY_PHASE,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
e3:SetCondition(s.eqconquick)
c:RegisterEffect(e3)
aux.AddEREquipLimit(c,s.eqconquick,s.eqval,s.equipop,e3)
end
s.listed_series={SET_ALLURE_QUEEN}
function s.spcostfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsDiscardable()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND,0,1,c) end
Duel.DiscardHand(tp,s.spcostfilter,1,1,REASON_COST|REASON_DISCARD,c)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.eqconignition(e,tp,eg,ep,ev,re,r,rp)
return not (e:GetHandler():IsOriginalSetCard(SET_ALLURE_QUEEN) and Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),EFFECT_GOLDEN_ALLURE_QUEEN))
end
function s.eqconquick(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsOriginalSetCard(SET_ALLURE_QUEEN) and Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),EFFECT_GOLDEN_ALLURE_QUEEN)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsMonster() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsMonster,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsMonster,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
end
function s.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(SET_ALLURE_QUEEN) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsFaceup()
and s.equipop(c,e,tp,tc) then
local code=tc:GetCode()
local attr_chk=tc:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK)
if not c:IsCode(code) then
--This card's name becomes that monster's until the End Phase
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)
Duel.AdjustInstantly(c)
end
if not (attr_chk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp)
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g==0 then return end
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.equipop(c,e,tp,tc)
return c:EquipByEffectAndLimitRegister(e,tp,tc,id)
end
function s.eqval(ec,c,tp)
return ec:IsMonster()
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
"Water Magician" + "Behegon"
|
--マリン・ビースト
--Marine Beast
local s,id=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,93343894,94022093)
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
When your opponent activates a Spell/Trap Card while you control an "Earthbound Immortal" monster: Negate the activation, and if you do, destroy it.
|
--地縛波
--Earthbound Wave
local s,id=GetID()
function s.initial_effect(c)
--Negate the activation fo a Spell/Trap card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_series={SET_EARTHBOUND_IMMORTAL}
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_EARTHBOUND_IMMORTAL)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_EARTHBOUND_IMMORTAL),tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
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:
|
If this card is Normal or Special Summoned: You can send 1 "Naturia" card from your Deck to the GY. If you would Tribute a monster(s) to activate a "Naturia" monster's effect, you can send the top 2 cards of your Deck to the GY instead. If your opponent Normal or Special Summons a monster (except during the Damage Step): You can Special Summon 1 "Naturia" monster from your GY. You can only use each effect of "Naturia Camellia" once per turn.
|
--ナチュル・カメリア
--Naturia Camellia
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Send 1 "Naturia" card from your Deck to the GY
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--If you would Tribute a monster(s) to activate a "Naturia" monster's effect, you can send the top 2 cards of your Deck to the GY instead
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(CARD_NATURIA_CAMELLIA)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
e3:SetCountLimit(1,{id,1})
e3:SetCondition(function(e) return Duel.IsPlayerCanDiscardDeckAsCost(e:GetHandlerPlayer(),2) end)
e3:SetValue(s.repval)
e3:SetOperation(s.repop)
c:RegisterEffect(e3)
--Special Summon 1 "Naturia" monster from your GY
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,{id,2})
e4:SetCondition(function(e,tp,eg) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
s.listed_series={SET_NATURIA}
function s.tgfilter(c)
return c:IsSetCard(SET_NATURIA) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon)
local c=e:GetHandler()
return c:IsSetCard(SET_NATURIA) and c:IsMonster() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp))
end
function s.repop(base,e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.DiscardDeck(tp,2,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(SET_NATURIA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
|
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
|
● While in Attack Position: If your opponent controls a face-up monster, this card can only select their highest ATK monster as an attack target. ● While in Defense Position: Your opponent cannot select another monster as an attack target.
|
--D・マグネンU
--Morphtronic Magnen
local s,id=GetID()
function s.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetCondition(s.cona)
e1:SetValue(s.vala)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetCondition(s.cona)
c:RegisterEffect(e2)
--def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetCondition(s.cond)
e3:SetValue(s.atlimit)
c:RegisterEffect(e3)
end
function s.cona(e)
return e:GetHandler():IsAttackPos()
and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandler():GetControler(),0,LOCATION_MZONE,1,nil)
end
function s.filter(c,atk)
return c:IsFaceup() and c:GetAttack()>atk
end
function s.vala(e,c)
if c:IsFaceup() then
return Duel.IsExistingMatchingCard(s.filter,c:GetControler(),LOCATION_MZONE,0,1,c,c:GetAttack())
else return true end
end
function s.cond(e)
return e:GetHandler():IsDefensePos()
end
function s.atlimit(e,c)
return c~=e:GetHandler()
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.