Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion constant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ EVENT_PAY_LPCOST = 1201
EVENT_DETACH_MATERIAL = 1202
EVENT_TURN_END = 1210
EVENT_CONFIRM = 1211
EVENT_TOHAND_CONFIRM = 1212
EVENT_TO_HAND_CONFIRM = 1212
EVENT_PHASE = 0x1000
EVENT_PHASE_START = 0x2000
EVENT_ADD_COUNTER = 0x10000
Expand Down
54 changes: 24 additions & 30 deletions official/c10802915.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,41 @@
--Tour Guide From the Underworld
local s,id=GetID()
function s.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--When this card is Normal Summoned: You can Special Summon 1 Level 3 Fiend monster from your hand or Deck, but negate its effects, also it cannot be used as Synchro Material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:GetLevel()==3 and c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function s.spfilter(c,e,tp)
return c:IsLevel(3) and c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
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 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local c=e:GetHandler()
--But negate its effects
sc:NegateEffects(c)
--Also it cannot be used as Synchro Material
local e1=Effect.CreateEffect(c)
e1:SetDescription(3310)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e3,true)
sc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
17 changes: 9 additions & 8 deletions official/c13409151.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@
--Desertapir
local s,id=GetID()
function s.initial_effect(c)
--flip
--FLIP: Target 1 face-up monster on the field, except "Desertapir"; change it to face-down Defense Position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_SET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.postg)
e1:SetOperation(s.posop)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsFaceup() and c:GetCode()~=id and c:IsCanTurnSet()
s.listed_names={id}
function s.posfilter(c)
return c:IsCanTurnSet() and not c:IsCode(id)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,tp,POS_FACEDOWN_DEFENSE)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if tc and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
61 changes: 30 additions & 31 deletions official/c1426714.lua
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@
--No.48 シャドー・リッチ
--No.48 シャドー・リッチ
--Number 48: Shadow Lich
local s,id=GetID()
local TOKEN_PHANTOM=id+1
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,3,2)
c:EnableReviveLimit()
--token
--Xyz Summon procedure: 2 Level 3 monsters
Xyz.AddProcedure(c,nil,3,2)
--Once per opponent's turn (Quick Effect): You can detach 1 material from this card; Special Summon 1 "Phantom Token" (Fiend-Type/DARK/Level 1/ATK 500/DEF 500)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_END_PHASE)
e1:SetCondition(s.spcon)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end)
e1:SetCost(Cost.DetachFromSelf(1))
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
c:RegisterEffect(e1)
--cannot be battle target
--While you control a "Phantom Token", your opponent's monsters cannot target this card for attacks
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetCondition(s.atkcon)
e2:SetValue(aux.imval2)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(function(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,TOKEN_PHANTOM),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end)
e2:SetValue(function(e,c)
return c==e:GetHandler()
end)
c:RegisterEffect(e2)
--atk
--Gains 500 ATK for each "Phantom Token" you control
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.atkval)
e3:SetValue(function(e,c)
return 500*Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsCode,TOKEN_PHANTOM),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)
end)
c:RegisterEffect(e3)
end
s.listed_names={1426715}
s.xyz_number=48
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp)
end
s.listed_names={TOKEN_PHANTOM}
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.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,500,500,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_PHANTOM) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,500,500,1,RACE_FIEND,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,id+1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_PHANTOM) then
local token=Duel.CreateToken(tp,TOKEN_PHANTOM)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.atkcon(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil,id+1)
end
function s.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsCode,c:GetControler(),LOCATION_ONFIELD,0,nil,id+1)*500
end
end
88 changes: 45 additions & 43 deletions official/c15001619.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,82 @@
--Puppet Queen
--Scripted by Cybercatman
local s,id=GetID()
local CARD_PUPPET_KING=3167573
function s.initial_effect(c)
--Special Summon itself from hand
--When your opponent adds a monster(s) from the Main Deck to their hand, except by drawing it (and except during the Damage Step): You can 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_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TOHAND_CONFIRM)
e1:SetCode(EVENT_TO_HAND_CONFIRM)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg1)
e1:SetOperation(s.spop1)
e1:SetCondition(s.selfspcon)
e1:SetTarget(s.selfsptg)
e1:SetOperation(s.selfspop)
c:RegisterEffect(e1)
--If Normal/Special Summoned, Special Summon 1 Level 7 EARTH Warrior from hand/GY
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--If this card is Normal or Special Summoned: You can Special Summon 1 Level 7 EARTH Warrior monster from your hand or GY, and if you Special Summoned "Puppet King" by this effect, all EARTH Warrior monsters you currently control gain 1000 ATK until the end of the next turn. You can only use this effect of "Puppet Queen" once per turn
local e2a=Effect.CreateEffect(c)
e2a:SetDescription(aux.Stringid(id,1))
e2a:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2a:SetProperty(EFFECT_FLAG_DELAY)
e2a:SetCode(EVENT_SUMMON_SUCCESS)
e2a:SetCountLimit(1,id)
e2a:SetTarget(s.handgysptg)
e2a:SetOperation(s.handgyspop)
c:RegisterEffect(e2a)
local e2b=e2a:Clone()
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2b)
end
s.listed_names={3167573}
function s.cfilter(c,tp)
s.listed_names={CARD_PUPPET_KING}
function s.selfspconfilter(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW)
and c:IsMonster() and c:IsPreviousControler(1-tp)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
function s.selfspcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.selfspconfilter,1,nil,tp)
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
function s.selfspop(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)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_EARTH)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
function s.handgyspfilter(c,e,tp)
return c:IsLevel(7) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function s.handgysptg(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|LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_HAND)
and Duel.IsExistingMatchingCard(s.handgyspfilter,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.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_EARTH)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR) and c:IsFaceup()
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
function s.handgyspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE|LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and g:GetFirst():IsCode(3167573) then
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.handgyspfilter),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 and sc:IsCode(CARD_PUPPET_KING) then
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil)
for tc in tg:Iter() do
--Increase ATK
local atkg=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil)
for atkc in atkg:Iter() do
--If you Special Summoned "Puppet King" by this effect, all EARTH Warrior monsters you currently control gain 1000 ATK until the end of the next turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESETS_STANDARD_PHASE_END,2)
e1:SetValue(1000)
tc:RegisterEffect(e1)
e1:SetReset(RESETS_STANDARD_PHASE_END,2)
atkc:RegisterEffect(e1)
end
end
end
Loading