Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
5899b21
"Flower Cardian" updates
pyrQ Jun 30, 2025
6f9b509
update utility.lua
that-hatter Jun 30, 2025
13816de
update "Tachyon Unit"
that-hatter Jun 30, 2025
fb59df8
remove uses of EFFECT_MARKER_DETACH_XMAT
that-hatter Jun 30, 2025
3c31f04
update "Ultimate Full Burst"
that-hatter Jul 1, 2025
a213d8a
"Allure Queen" updates
pyrQ Jul 1, 2025
6dae825
"Constellar" updates
pyrQ Jul 1, 2025
463128f
update "Utopia Rising"
that-hatter Jul 1, 2025
24daba4
update "XYZ Wings"
that-hatter Jul 1, 2025
e812b93
Update c511004123.lua
that-hatter Jul 1, 2025
4a824cb
update "Rank-Up-Magic Cipher Pursuit"
that-hatter Jul 1, 2025
2d0318c
Update c511003038.lua
that-hatter Jul 1, 2025
2661ef7
update "Raidraptor - Rapid Xyz"
that-hatter Jul 1, 2025
d19e67e
update "Overlay Wedge"
that-hatter Jul 1, 2025
dd3c4ca
"tellarknight" updates
pyrQ Jul 2, 2025
fe1a088
update "Number C65: King Overfiend"
that-hatter Jul 2, 2025
6523cd4
update "Number F0: Utopic Future Slash"
that-hatter Jul 2, 2025
772dcaf
Updated some Xyz Monsters that weren't using the "Cost.Detach" function
pyrQ Jul 2, 2025
1ca3b3a
Update utility.lua
that-hatter Jul 3, 2025
c5b7f11
update "Thunder Dragon" monsters
that-hatter Jul 3, 2025
799ae70
update "Thunder Dragon Thunderstormech"
that-hatter Jul 3, 2025
2ee5694
Update c12081875.lua
that-hatter Jul 3, 2025
5ebd336
add "Dragon Ruler" cost helper functions
that-hatter Jul 3, 2025
4688780
update "Chasma, Dragon Ruler of Auroras"
that-hatter Jul 3, 2025
abcbcd2
update "Dragon Ruler" monsters that discard themselves
that-hatter Jul 3, 2025
fdb8792
Update c12081875.lua
that-hatter Jul 3, 2025
f26fc51
"Tellarknight Constellar Caduceus" label fix + "Number C32: Shark Dra…
pyrQ Jul 4, 2025
ef42f93
Update "Allure Palace (Anime)" to also use a cost table
pyrQ Jul 4, 2025
8229018
"Thunder Dragon Thunderstormech" updates
pyrQ Jul 4, 2025
1916a91
baby ruler cost should be "Cost.SelfDiscard"
pyrQ Jul 4, 2025
8a7f3a7
DRulers smol updates
pyrQ Jul 4, 2025
4efb323
Updated "Numeron Network" to use "EFFECT_OVERLAY_REMOVE_REPLACE"
pyrQ Jul 4, 2025
bced375
Update some anime cards to use "Cost.Detach"
pyrQ Jul 4, 2025
26ac24f
Use "Card.GetOverlayCount"
pyrQ Jul 4, 2025
1e7502f
Update c511001363.lua
that-hatter Jul 4, 2025
84412dd
Update c511009567.lua
pyrQ Jul 5, 2025
f6f56e8
Update c511009480.lua
pyrQ Jul 5, 2025
a18a68b
Update utility.lua
that-hatter Jul 5, 2025
105dbc4
update some official cards to use Cost.Detach
that-hatter Jul 5, 2025
1ebdf5b
updates/fixes
pyrQ Jul 6, 2025
3c09f21
Update utility.lua
pyrQ Jul 6, 2025
8e2379f
update "Primathmech Laplacian"
that-hatter Jul 6, 2025
63184ec
add Cost.Choice
that-hatter Jul 6, 2025
7e12db7
update "Wollow, Founder of the Drudge Dragons"
that-hatter Jul 6, 2025
220c505
update "Starliege Lord Galaxion"
that-hatter Jul 6, 2025
9f43fd9
update "Primathmech Alembertian"
that-hatter Jul 6, 2025
2982a8b
fix typos
that-hatter Jul 6, 2025
c5bf0a9
Update c85692042.lua
pyrQ Jul 6, 2025
58643c3
Update c88021907.lua
pyrQ Jul 6, 2025
c87cfbf
Apply 88 Cost.Detach
NaimSantos Jul 6, 2025
57eb5a1
Some Xyz updates
pyrQ Jul 6, 2025
d7d23ff
Added "Cost.HintSelectedEffect"
pyrQ Jul 7, 2025
c8e270a
More Xyz updates
pyrQ Jul 7, 2025
263cdbe
update "Number 46: Dragluon"
that-hatter Jul 7, 2025
1504526
Update c2978414.lua
that-hatter Jul 7, 2025
0f0141b
Update c2978414.lua
that-hatter Jul 7, 2025
275e8d5
update "Number 87: Queen of the Night"
that-hatter Jul 7, 2025
2286dfd
update "Number 91: Thunder Spark Dragon"
that-hatter Jul 7, 2025
4815f62
update "Evolzar Lars"
that-hatter Jul 7, 2025
fffee05
add missing categories
that-hatter Jul 7, 2025
0871420
Added new card constants
pyrQ Jul 7, 2025
46e37cd
Update archetype_setcode_constants.lua
that-hatter Jul 8, 2025
b368e55
Added new card scripts
pyrQ Jul 8, 2025
46d1a3f
"Synchro Fellows" update
NaimSantos Jul 8, 2025
8513a4e
Added new card scripts
pyrQ Jul 8, 2025
799070b
added scripts for new alt arts
Yoshi80 Jul 8, 2025
9bd72be
Added new archetype constant
pyrQ Jul 9, 2025
d695845
added Ritty the Hopeful
Yoshi80 Jul 9, 2025
1ae19e5
"Zexal Field" fix
NaimSantos Jul 9, 2025
73a3a16
Some more Xyz updates
pyrQ Jul 10, 2025
a0b1b37
Added new card scripts
pyrQ Jul 10, 2025
7f3bfc2
"Concours de Cuisine (Culinary Confrontation)" fix
NaimSantos Jul 10, 2025
3b6f9d3
Update "Nouvelles" Ritual monsters
NaimSantos Jul 10, 2025
03369c2
update c14283055.lua
NaimSantos Jul 10, 2025
454bc6d
Moar Xyz updates
pyrQ Jul 10, 2025
46fa2e3
"Number 46: Dragluon" updates
pyrQ Jul 10, 2025
e05cadf
Update c2978414.lua
pyrQ Jul 10, 2025
0f5baa0
Update c89516305.lua
pyrQ Jul 10, 2025
d07a64b
Update c84417082.lua
pyrQ Jul 11, 2025
48b2fa2
Update c35103106.lua
pyrQ Jul 11, 2025
51439c3
unofficial Xyz updates
pyrQ Jul 11, 2025
129a6b6
Missing bracket
pyrQ Jul 11, 2025
9fb329a
added scripts for new alt arts
Yoshi80 Jul 12, 2025
3d7bcfa
Update c12081875.lua
pyrQ Jul 12, 2025
9de4155
Update c49195710.lua
pyrQ Jul 12, 2025
62d4f7f
Update c43490025.lua
pyrQ Jul 12, 2025
b364476
"Traptrix Rafflesia" update
pyrQ Jul 12, 2025
fda5fce
Fix Destiny Overlay
edo9300 Jul 12, 2025
cb29320
Update "Destiny Overlay"
TheRazgriz Jul 12, 2025
5940fc8
"Flower Cardian" updates
pyrQ Jun 30, 2025
bd0bd0b
update utility.lua
that-hatter Jun 30, 2025
5bc59cc
update "Tachyon Unit"
that-hatter Jun 30, 2025
a3439dd
remove uses of EFFECT_MARKER_DETACH_XMAT
that-hatter Jun 30, 2025
a49c981
update "Ultimate Full Burst"
that-hatter Jul 1, 2025
6b24b36
"Allure Queen" updates
pyrQ Jul 1, 2025
56dbf69
"Constellar" updates
pyrQ Jul 1, 2025
47db747
update "Utopia Rising"
that-hatter Jul 1, 2025
b2fb1dc
update "XYZ Wings"
that-hatter Jul 1, 2025
d0ab09f
Update c511004123.lua
that-hatter Jul 1, 2025
6a4a528
update "Rank-Up-Magic Cipher Pursuit"
that-hatter Jul 1, 2025
4921546
Update c511003038.lua
that-hatter Jul 1, 2025
82d83a1
update "Raidraptor - Rapid Xyz"
that-hatter Jul 1, 2025
2a3c399
update "Overlay Wedge"
that-hatter Jul 1, 2025
839c48e
"tellarknight" updates
pyrQ Jul 2, 2025
ce6425f
update "Number C65: King Overfiend"
that-hatter Jul 2, 2025
57539e9
update "Number F0: Utopic Future Slash"
that-hatter Jul 2, 2025
a7e308d
Updated some Xyz Monsters that weren't using the "Cost.Detach" function
pyrQ Jul 2, 2025
053acce
Update utility.lua
that-hatter Jul 3, 2025
53986ee
update "Thunder Dragon" monsters
that-hatter Jul 3, 2025
bcf04f1
update "Thunder Dragon Thunderstormech"
that-hatter Jul 3, 2025
88038f8
Update c12081875.lua
that-hatter Jul 3, 2025
5dba075
add "Dragon Ruler" cost helper functions
that-hatter Jul 3, 2025
ad68e64
update "Chasma, Dragon Ruler of Auroras"
that-hatter Jul 3, 2025
fa63da2
update "Dragon Ruler" monsters that discard themselves
that-hatter Jul 3, 2025
d87d0e6
Update c12081875.lua
that-hatter Jul 3, 2025
730a78a
"Tellarknight Constellar Caduceus" label fix + "Number C32: Shark Dra…
pyrQ Jul 4, 2025
425780f
Update "Allure Palace (Anime)" to also use a cost table
pyrQ Jul 4, 2025
cfbbba9
"Thunder Dragon Thunderstormech" updates
pyrQ Jul 4, 2025
74240e6
baby ruler cost should be "Cost.SelfDiscard"
pyrQ Jul 4, 2025
5ace4d0
DRulers smol updates
pyrQ Jul 4, 2025
6686e5c
Updated "Numeron Network" to use "EFFECT_OVERLAY_REMOVE_REPLACE"
pyrQ Jul 4, 2025
2e11f05
Update some anime cards to use "Cost.Detach"
pyrQ Jul 4, 2025
1f922a5
Use "Card.GetOverlayCount"
pyrQ Jul 4, 2025
2ab848b
Update c511001363.lua
that-hatter Jul 4, 2025
8a46e2e
Update c511009567.lua
pyrQ Jul 5, 2025
668bc06
Update c511009480.lua
pyrQ Jul 5, 2025
ed7472c
Update utility.lua
that-hatter Jul 5, 2025
0ac21ad
update some official cards to use Cost.Detach
that-hatter Jul 5, 2025
15fdbbe
updates/fixes
pyrQ Jul 6, 2025
a086255
Update utility.lua
pyrQ Jul 6, 2025
1fec394
update "Primathmech Laplacian"
that-hatter Jul 6, 2025
23309b5
add Cost.Choice
that-hatter Jul 6, 2025
e827504
update "Wollow, Founder of the Drudge Dragons"
that-hatter Jul 6, 2025
2796706
update "Starliege Lord Galaxion"
that-hatter Jul 6, 2025
186dce8
update "Primathmech Alembertian"
that-hatter Jul 6, 2025
ec78d0b
fix typos
that-hatter Jul 6, 2025
7f5e9c0
Update c85692042.lua
pyrQ Jul 6, 2025
290f358
Update c88021907.lua
pyrQ Jul 6, 2025
27b8ad4
Apply 88 Cost.Detach
NaimSantos Jul 6, 2025
8bf9867
Some Xyz updates
pyrQ Jul 6, 2025
bda2c8c
Added "Cost.HintSelectedEffect"
pyrQ Jul 7, 2025
8650f4e
More Xyz updates
pyrQ Jul 7, 2025
598ab91
update "Number 46: Dragluon"
that-hatter Jul 7, 2025
0b0b148
Update c2978414.lua
that-hatter Jul 7, 2025
da18366
Update c2978414.lua
that-hatter Jul 7, 2025
7e72788
update "Number 87: Queen of the Night"
that-hatter Jul 7, 2025
a868d7d
update "Number 91: Thunder Spark Dragon"
that-hatter Jul 7, 2025
1449772
update "Evolzar Lars"
that-hatter Jul 7, 2025
782c3d9
add missing categories
that-hatter Jul 7, 2025
26e999e
Some more Xyz updates
pyrQ Jul 10, 2025
98f611d
Moar Xyz updates
pyrQ Jul 10, 2025
9efe3a7
"Number 46: Dragluon" updates
pyrQ Jul 10, 2025
1025798
Update c2978414.lua
pyrQ Jul 10, 2025
c70e6d5
Update c89516305.lua
pyrQ Jul 10, 2025
4a8bbaa
Update c84417082.lua
pyrQ Jul 11, 2025
88fba28
Update c35103106.lua
pyrQ Jul 11, 2025
5d45ecb
unofficial Xyz updates
pyrQ Jul 11, 2025
14efc56
Missing bracket
pyrQ Jul 11, 2025
e931f74
Update c12081875.lua
pyrQ Jul 12, 2025
ddd6bb9
Update c49195710.lua
pyrQ Jul 12, 2025
f473f97
Update c43490025.lua
pyrQ Jul 12, 2025
d353024
"Traptrix Rafflesia" update
pyrQ Jul 12, 2025
907aaa2
Merge branch 'deprecate-existing-effect-markers' of https://github.co…
that-hatter Jul 12, 2025
7e072ba
rename Cost.Detach to Cost.DetachFromSelf
that-hatter Jul 12, 2025
d1db120
Update c511009560.lua
that-hatter Jul 12, 2025
eb6d0cd
Update c511001781.lua
that-hatter Jul 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions archetype_setcode_constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -596,3 +596,5 @@ SET_ARTMEGIA = 0x1c7
SET_DOOM_KING = 0x1c8
SET_MAGNIFISTORM = 0x1c9
SET_RB = 0x1ca
SET_DOOM_Z = 0x1cb
SET_HECATONCHEIRE = 0x1cc
2 changes: 2 additions & 0 deletions card_counter_constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ CARD_HARPIE_LADY_SISTERS = 12206212
CARD_INFERNOBLE_CHARLES = 77656797
CARD_JACK_KNIGHT = 90876561
CARD_JINZO = 77585513
CARD_JUNK_SYNCHRON = 63977008
CARD_JUNK_WARRIOR = 60800381
CARD_KAZEJIN = 62340868
CARD_KING_KNIGHT = 64788463
CARD_KING_SARCOPHAGUS = 16528181
Expand Down
27 changes: 27 additions & 0 deletions cards_specific_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1239,3 +1239,30 @@ function Infernoid.RegisterSummonProcedure(c,monstersToBanish)
e2:SetOperation(InfernoidInt.summonOperation)
c:RegisterEffect(e2)
end

DragonRuler={}
do
local function discard_with_other_cost(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(filter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g+c,REASON_COST|REASON_DISCARD)
end
end
--For Level 7 monsters (can only discard to GY, and does not allow Dragons)
function DragonRuler.SelfDiscardToGraveCost(attr)
local function other_discard_to_grave_filter(c)
return c:IsAttribute(attr) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
return Cost.AND(discard_with_other_cost(other_discard_to_grave_filter),Cost.SelfDiscardToGrave)
end
--For lower Level monsters (not limited to discarding to GY, and allows Dragons)
function DragonRuler.SelfDiscardCost(attr)
local function other_discard_filter(c)
return (c:IsAttribute(attr) or c:IsRace(RACE_DRAGON)) and c:IsDiscardable()
end
return Cost.AND(discard_with_other_cost(other_discard_filter),Cost.SelfDiscard)
end
end
2 changes: 1 addition & 1 deletion deprecated_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ make_deprecated_function_no_replacement("Duel.GetTributeCount", "You should use
make_deprecated_function_alias("Auxiliary.selfbanishcost","Cost.SelfBanish")
make_deprecated_function_alias("Auxiliary.SelfBanishCost","Cost.SelfBanish")
make_deprecated_function_alias("Auxiliary.DiscardCost","Cost.Discard")
make_deprecated_function_alias("Auxiliary.dxmcostgen","Cost.Detach")
make_deprecated_function_alias("Auxiliary.dxmcostgen","Cost.DetachFromSelf")
make_deprecated_function_alias("Auxiliary.selfreleasecost","Cost.SelfRelease")
make_deprecated_function_alias("Auxiliary.SelfReleaseCost","Cost.SelfRelease")
make_deprecated_function_alias("Auxiliary.SelfTributeCost","Cost.SelfRelease")
Expand Down
27 changes: 11 additions & 16 deletions goat/c504700054.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,32 @@
--"“Thunder Dragon” may be discarded to search for 0 “Thunder Dragons” in the player’s deck." netrep ruling
local s,id=GetID()
function s.initial_effect(c)
--search
--Add up to 2 "Thunder Dragon" cards from your Deck to your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1,false,EFFECT_MARKER_THUNDRA)
e1:SetCost(Cost.SelfDiscard)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
s.listed_names={31786629}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.filter(c)
function s.thfilter(c)
return c:IsCode(31786629) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp,chk)
function s.thop(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,0,2,nil)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,0,2,nil)
if g and #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
else
if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) then Duel.GoatConfirm(tp,LOCATION_DECK) end
elseif not Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.GoatConfirm(tp,LOCATION_DECK)
end
end
22 changes: 8 additions & 14 deletions official/c10000030.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Xyz Summon procedure
--Xyz Summon procedure: 2 Level 6 Spellcaster monsters
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),6,2)
--Activate 1 of these effects
local e1=Effect.CreateEffect(c)
Expand All @@ -12,36 +12,30 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.effcost)
e1:SetCost(Cost.AND(Cost.DetachFromSelf(1),s.effcost))
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT)
c:RegisterEffect(e1)
end
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if not chkc:IsControler(1-tp) then return false end
local op=e:GetLabel()
if op==1 then
return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControlerCanBeChanged()
elseif op==2 then
return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp)
return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
end
local b1=Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp)
and Duel.IsExistingTarget(Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,nil,e,0,tp,false,false)
if chk==0 then return b1 or b2 end
local op=Duel.SelectEffect(tp,
{b1,aux.Stringid(id,1)},
Expand All @@ -55,7 +49,7 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
elseif op==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,Card.IsCanBeSpecialSummoned,tp,0,LOCATION_GRAVE,1,1,nil,e,0,tp,false,false)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
end
end
Expand All @@ -70,4 +64,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
--Special Summon 1 monster from your opponent's GY
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
84 changes: 26 additions & 58 deletions official/c10389142.lua
Original file line number Diff line number Diff line change
@@ -1,84 +1,52 @@
--No.42 スターシップ・ギャラクシー・トマホーク
--No.42 スターシップ・ギャラクシー・トマホーク
--Number 42: Galaxy Tomahawk
local s,id=GetID()
local TOKEN_BATTLE_EAGLE=id+1
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,7,2)
c:EnableReviveLimit()
--token
--Xyz Summon procedure: 2 Level 7 monsters
Xyz.AddProcedure(c,nil,7,2)
--Special Summon as many "Battle Eagle Tokens" (Machine-Type/WIND/Level 6/ATK 2000/DEF 0) as possible, but destroy them during the End Phase of this turn, also your opponent takes no further battle damage this turn
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.spcost)
e1:SetCountLimit(1)
e1:SetCost(Cost.DetachFromSelf(2))
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1,false,EFFECT_MARKER_DETACH_XMAT)
c:RegisterEffect(e1)
end
s.listed_names={10389143}
s.xyz_number=42
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
s.listed_names={TOKEN_BATTLE_EAGLE}
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,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,tp,0)
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) 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)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
local fid=e:GetHandler():GetFieldID()
local g=Group.CreateGroup()
local sg=Group.CreateGroup()
for i=1,ft do
local token=Duel.CreateToken(tp,id+1)
local token=Duel.CreateToken(tp,TOKEN_BATTLE_EAGLE)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
token:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid)
g:AddCard(token)
sg:AddCard(token)
end
--Destroy them during the End Phase of this turn
aux.DelayedOperation(sg,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,nil,1,aux.Stringid(id,1))
Duel.SpecialSummonComplete()
g:KeepAlive()
--Your opponent takes no further battle damage this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetReset(RESET_PHASE|PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
Duel.RegisterEffect(e1,tp)
end
function s.desfilter(c,fid)
return c:GetFlagEffectLabel(id)==fid
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(s.desfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(s.desfilter,nil,e:GetLabel())
g:DeleteGroup()
Duel.Destroy(tg,REASON_EFFECT)
end
6 changes: 3 additions & 3 deletions official/c10406322.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function s.initial_effect(c)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.tdcon)
e2:SetCost(Cost.Detach(1,1,nil))
e2:SetCost(Cost.DetachFromSelf(1,1,nil))
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2,false,EFFECT_MARKER_DETACH_XMAT)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Expand Down Expand Up @@ -75,4 +75,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
else
Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
end
6 changes: 3 additions & 3 deletions official/c10443957.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.discon)
e3:SetCost(Cost.Detach(1))
e3:SetCost(Cost.DetachFromSelf(1))
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3,false,EFFECT_MARKER_DETACH_XMAT)
c:RegisterEffect(e3)
end
s.listed_names={58069384}
function s.mfilter(c,xyz,sumtype,tp)
Expand Down Expand Up @@ -83,4 +83,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
44 changes: 22 additions & 22 deletions official/c1050186.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@
--Satellarknight Unukalhai
local s,id=GetID()
function s.initial_effect(c)
--Send 1 "tellarknight" card 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:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1,false,EFFECT_MARKER_TELLAR)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--Send 1 "tellarknight" card from your Deck to the GY, except "Satellarknight Unukalhai"
local e1a=Effect.CreateEffect(c)
e1a:SetDescription(aux.Stringid(id,0))
e1a:SetCategory(CATEGORY_TOGRAVE)
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1a:SetProperty(EFFECT_FLAG_DELAY)
e1a:SetCode(EVENT_SUMMON_SUCCESS)
e1a:SetCountLimit(1,id)
e1a:SetTarget(s.tgtg)
e1a:SetOperation(s.tgop)
c:RegisterEffect(e1a)
local e1b=e1a:Clone()
e1b:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1b)
local e1c=e1a:Clone()
e1c:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1c)
end
s.listed_series={SET_TELLARKNIGHT}
s.listed_names={id}
function s.filter(c)
function s.tgfilter(c)
return c:IsSetCard(SET_TELLARKNIGHT) and not c:IsCode(id) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
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.operation(e,tp,eg,ep,ev,re,r,rp)
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
Expand Down
Loading