Skip to content

Commit 73a3a16

Browse files
authored
Some more Xyz updates
1 parent fffee05 commit 73a3a16

3 files changed

Lines changed: 79 additions & 146 deletions

File tree

official/c10389142.lua

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,52 @@
1-
--No.42 スターシップ・ギャラクシー・トマホーク
1+
--No.42 スターシップ・ギャラクシー・トマホーク
22
--Number 42: Galaxy Tomahawk
33
local s,id=GetID()
4+
local TOKEN_BATTLE_EAGLE=id+1
45
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,7,2)
76
c:EnableReviveLimit()
8-
--token
7+
--Xyz Summon procedure: 2 Level 7 monsters
8+
Xyz.AddProcedure(c,nil,7,2)
9+
--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
910
local e1=Effect.CreateEffect(c)
10-
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
1111
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_DESTROY)
1213
e1:SetType(EFFECT_TYPE_IGNITION)
13-
e1:SetCountLimit(1)
1414
e1:SetRange(LOCATION_MZONE)
15-
e1:SetCost(s.spcost)
15+
e1:SetCountLimit(1)
16+
e1:SetCost(Cost.Detach(2))
1617
e1:SetTarget(s.sptg)
1718
e1:SetOperation(s.spop)
1819
c:RegisterEffect(e1)
1920
end
20-
s.listed_names={10389143}
2121
s.xyz_number=42
22-
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
23-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
24-
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
25-
local e1=Effect.CreateEffect(e:GetHandler())
26-
e1:SetType(EFFECT_TYPE_FIELD)
27-
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
28-
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
29-
e1:SetTargetRange(0,1)
30-
e1:SetValue(1)
31-
e1:SetReset(RESET_PHASE|PHASE_END)
32-
Duel.RegisterEffect(e1,tp)
33-
end
22+
s.listed_names={TOKEN_BATTLE_EAGLE}
3423
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
3524
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
36-
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end
37-
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
38-
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
39-
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0)
40-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,tp,0)
25+
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) end
26+
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
27+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
4128
end
4229
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4330
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
44-
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end
31+
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_BATTLE_EAGLE,0,TYPES_TOKEN,2000,0,6,RACE_MACHINE,ATTRIBUTE_WIND) then return end
4532
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
46-
local fid=e:GetHandler():GetFieldID()
47-
local g=Group.CreateGroup()
33+
local sg=Group.CreateGroup()
4834
for i=1,ft do
49-
local token=Duel.CreateToken(tp,id+1)
35+
local token=Duel.CreateToken(tp,TOKEN_BATTLE_EAGLE)
5036
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
51-
token:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid)
52-
g:AddCard(token)
37+
sg:AddCard(token)
5338
end
39+
--Destroy them during the End Phase of this turn
40+
aux.DelayedOperation(sg,PHASE_END,id,e,tp,function(ag) Duel.Destroy(ag,REASON_EFFECT) end,nil,nil,1,aux.Stringid(id,1))
5441
Duel.SpecialSummonComplete()
55-
g:KeepAlive()
42+
--Your opponent takes no further battle damage this turn
5643
local e1=Effect.CreateEffect(e:GetHandler())
57-
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
58-
e1:SetCode(EVENT_PHASE+PHASE_END)
59-
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
44+
e1:SetDescription(aux.Stringid(id,2))
45+
e1:SetType(EFFECT_TYPE_FIELD)
46+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
47+
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
48+
e1:SetTargetRange(0,1)
49+
e1:SetValue(1)
6050
e1:SetReset(RESET_PHASE|PHASE_END)
61-
e1:SetCountLimit(1)
62-
e1:SetLabel(fid)
63-
e1:SetLabelObject(g)
64-
e1:SetCondition(s.descon)
65-
e1:SetOperation(s.desop)
6651
Duel.RegisterEffect(e1,tp)
67-
end
68-
function s.desfilter(c,fid)
69-
return c:GetFlagEffectLabel(id)==fid
70-
end
71-
function s.descon(e,tp,eg,ep,ev,re,r,rp)
72-
local g=e:GetLabelObject()
73-
if not g:IsExists(s.desfilter,1,nil,e:GetLabel()) then
74-
g:DeleteGroup()
75-
e:Reset()
76-
return false
77-
else return true end
78-
end
79-
function s.desop(e,tp,eg,ep,ev,re,r,rp)
80-
local g=e:GetLabelObject()
81-
local tg=g:Filter(s.desfilter,nil,e:GetLabel())
82-
g:DeleteGroup()
83-
Duel.Destroy(tg,REASON_EFFECT)
84-
end
52+
end

official/c31437713.lua

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,51 @@
22
--Number 82: Heartlandraco
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Must be properly summoned before reviving
65
c:EnableReviveLimit()
7-
--Xyz summon procedure
6+
--Xyz Summon procedure: 2 Level 4 monsters
87
Xyz.AddProcedure(c,nil,4,2)
9-
--Cannot be targeted for attack
8+
--While you control a face-up Spell, your opponent cannot target this card for attacks
109
local e1=Effect.CreateEffect(c)
1110
e1:SetType(EFFECT_TYPE_SINGLE)
1211
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13-
e1:SetRange(LOCATION_MZONE)
1412
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
15-
e1:SetCondition(s.atkcon)
13+
e1:SetRange(LOCATION_MZONE)
14+
e1:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSpell),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end)
1615
e1:SetValue(aux.imval1)
1716
c:RegisterEffect(e1)
18-
--Make itself be able to attack directly
17+
--Apply a "this turn, this card can attack your opponent directly, but other monsters cannot attack" effect
1918
local e2=Effect.CreateEffect(c)
2019
e2:SetDescription(aux.Stringid(id,0))
2120
e2:SetType(EFFECT_TYPE_IGNITION)
22-
e2:SetCountLimit(1)
2321
e2:SetRange(LOCATION_MZONE)
24-
e2:SetCondition(s.condition)
25-
e2:SetCost(s.cost)
26-
e2:SetOperation(s.operation)
22+
e2:SetCountLimit(1)
23+
e2:SetCondition(function(e) return Duel.IsAbleToEnterBP() and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK) end)
24+
e2:SetCost(Cost.Detach(1))
25+
e2:SetOperation(s.effop)
2726
c:RegisterEffect(e2)
2827
end
2928
s.xyz_number=82
30-
function s.filter(c)
31-
return c:IsFaceup() and c:IsSpell()
32-
end
33-
function s.atkcon(e)
34-
return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
35-
end
36-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
37-
return Duel.IsAbleToEnterBP() and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK)
38-
end
39-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
40-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
41-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
42-
local e1=Effect.CreateEffect(e:GetHandler())
43-
e1:SetType(EFFECT_TYPE_FIELD)
44-
e1:SetCode(EFFECT_CANNOT_ATTACK)
45-
e1:SetProperty(EFFECT_FLAG_OATH)
46-
e1:SetTargetRange(LOCATION_MZONE,0)
47-
e1:SetTarget(s.ftarget)
48-
e1:SetLabel(e:GetHandler():GetFieldID())
49-
e1:SetReset(RESET_PHASE|PHASE_END)
50-
Duel.RegisterEffect(e1,tp)
51-
end
52-
function s.ftarget(e,c)
53-
return e:GetLabel()~=c:GetFieldID()
54-
end
55-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
29+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
30+
local fid=-1
5631
local c=e:GetHandler()
57-
if c:IsFaceup() and c:IsRelateToEffect(e) then
58-
--Attack directly this turn
59-
local e1=Effect.CreateEffect(e:GetHandler())
32+
if c:IsRelateToEffect(e) then
33+
fid=c:GetFieldID()
34+
--This turn, this card can attack your opponent directly
35+
local e1=Effect.CreateEffect(c)
6036
e1:SetDescription(3205)
61-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
6237
e1:SetType(EFFECT_TYPE_SINGLE)
38+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
6339
e1:SetCode(EFFECT_DIRECT_ATTACK)
6440
e1:SetReset(RESETS_STANDARD_PHASE_END)
6541
c:RegisterEffect(e1)
6642
end
67-
end
43+
aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,1))
44+
--But other monsters cannot attack
45+
local e2=Effect.CreateEffect(c)
46+
e2:SetType(EFFECT_TYPE_FIELD)
47+
e2:SetCode(EFFECT_CANNOT_ATTACK)
48+
e2:SetTargetRange(LOCATION_MZONE,0)
49+
e2:SetTarget(function(e,c) return c:GetFieldID()~=fid end)
50+
e2:SetReset(RESET_PHASE|PHASE_END)
51+
Duel.RegisterEffect(e2,tp)
52+
end

official/c56337500.lua

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,61 @@
44
local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2 Level 3 monsters
78
Xyz.AddProcedure(c,nil,3,2)
8-
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
9-
--salvage
9+
--Add 1 "Cynet" Spell/Trap from your GY to your hand
1010
local e1=Effect.CreateEffect(c)
1111
e1:SetDescription(aux.Stringid(id,0))
1212
e1:SetCategory(CATEGORY_TOHAND)
1313
e1:SetType(EFFECT_TYPE_IGNITION)
14-
e1:SetRange(LOCATION_MZONE)
1514
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
15+
e1:SetRange(LOCATION_MZONE)
1616
e1:SetCountLimit(1,id)
17-
e1:SetCost(s.thcost)
17+
e1:SetCost(Cost.AND(Cost.Detach(1),s.cost))
1818
e1:SetTarget(s.thtg)
1919
e1:SetOperation(s.thop)
2020
c:RegisterEffect(e1)
21-
--spsummon
21+
--Special Summon 2 Level 4 Cyberse monsters with different names from your Deck, but their effects are negated
2222
local e2=Effect.CreateEffect(c)
2323
e2:SetDescription(aux.Stringid(id,1))
24-
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
24+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
2525
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
26-
e2:SetCode(EVENT_DESTROYED)
2726
e2:SetProperty(EFFECT_FLAG_DELAY)
27+
e2:SetCode(EVENT_DESTROYED)
2828
e2:SetCountLimit(1,{id,1})
2929
e2:SetCondition(s.spcon)
3030
e2:SetCost(s.cost)
3131
e2:SetTarget(s.sptg)
3232
e2:SetOperation(s.spop)
3333
c:RegisterEffect(e2)
34+
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_CYBERSE) end)
3435
end
3536
s.listed_series={SET_CYNET}
36-
function s.counterfilter(c)
37-
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_CYBERSE)
38-
end
3937
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
4038
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
41-
local e1=Effect.CreateEffect(e:GetHandler())
39+
local c=e:GetHandler()
40+
--You cannot Special Summon monsters from the Extra Deck the turn you activate either of this card's effects, except Cyberse monsters
41+
local e1=Effect.CreateEffect(c)
4242
e1:SetDescription(aux.Stringid(id,2))
4343
e1:SetType(EFFECT_TYPE_FIELD)
4444
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
4545
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
4646
e1:SetTargetRange(1,0)
47-
e1:SetTarget(s.splimit)
47+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_CYBERSE) end)
4848
e1:SetReset(RESET_PHASE|PHASE_END)
4949
Duel.RegisterEffect(e1,tp)
50-
--lizard check
51-
aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter)
52-
end
53-
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
54-
return not c:IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_EXTRA)
55-
end
56-
function s.lizfilter(e,c)
57-
return not c:IsOriginalRace(RACE_CYBERSE)
58-
end
59-
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
60-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
61-
and s.cost(e,tp,eg,ep,ev,re,r,rp,0) end
62-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
63-
s.cost(e,tp,eg,ep,ev,re,r,rp,1)
50+
--"Clock Lizard" check
51+
aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalRace(RACE_CYBERSE) end)
6452
end
6553
function s.thfilter(c)
66-
return c:IsSpellTrap() and c:IsSetCard(SET_CYNET) and c:IsAbleToHand()
54+
return c:IsSetCard(SET_CYNET) and c:IsSpellTrap() and c:IsAbleToHand()
6755
end
6856
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6957
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
7058
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
7159
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
7260
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
73-
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
61+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
7462
end
7563
function s.thop(e,tp,eg,ep,ev,re,r,rp)
7664
local tc=Duel.GetFirstTarget()
@@ -80,11 +68,11 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
8068
end
8169
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
8270
local c=e:GetHandler()
83-
return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)))
84-
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsXyzSummoned()
71+
return c:IsXyzSummoned() and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)))
72+
and c:IsPreviousLocation(LOCATION_MZONE)
8573
end
8674
function s.spfilter(c,e,tp)
87-
return c:IsRace(RACE_CYBERSE) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
75+
return c:IsLevel(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
8876
end
8977
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
9078
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
@@ -97,21 +85,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
9785
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
9886
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
9987
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_SPSUMMON)
100-
if #sg==2 then
101-
local tc=sg:GetFirst()
102-
for tc in aux.Next(sg) do
103-
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
104-
local e1=Effect.CreateEffect(e:GetHandler())
105-
e1:SetType(EFFECT_TYPE_SINGLE)
106-
e1:SetCode(EFFECT_DISABLE)
107-
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
108-
tc:RegisterEffect(e1,true)
109-
local e2=Effect.CreateEffect(e:GetHandler())
110-
e2:SetType(EFFECT_TYPE_SINGLE)
111-
e2:SetCode(EFFECT_DISABLE_EFFECT)
112-
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
113-
tc:RegisterEffect(e2,true)
88+
if #sg~=2 then return end
89+
local c=e:GetHandler()
90+
for sc in sg:Iter() do
91+
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
92+
--Their effects are negated
93+
sc:NegateEffects(c)
11494
end
115-
Duel.SpecialSummonComplete()
11695
end
117-
end
96+
Duel.SpecialSummonComplete()
97+
end

0 commit comments

Comments
 (0)