Skip to content

Commit 8cf5cf2

Browse files
authored
Various script fixes/updates
- Bettan Bat: Fixed the first effect being usable 3 times for Normal Summons and 3 times for Special Summons instead of 3 times total. - Blue Flame Swordsman: Resolve doing nothing if this card has less than 600 ATK on resolution + don't Special Summon the target if it's not a FIRE Warrior anymore on resolution. - Dodododo Warrior: Should be treated as the Special Summon of a Level 4 monster with 1800 ATK for the purposes of other effects. - Full House: Made the targeting selection smoother. - Jinzo - Layered: Tributing a monster and destroying a face-up card should happen at the same time + the "cannot activate its effects or declare an attack" effects should stop applying if control of the monster switches back + check that there is a monster to Tribute so that there would still be another face-up card on the field to destroy. - Meklord Astro Dragon Triskelion: Added missing effect categories. - The Abyss Dragon Swordsoul: Fixed some cases where an effect that should have been able to be activated to Special Summon this card wasn't able to be activated. - The Sanctified Darklord: Fixed some cases where there would be a script error when the selected monster was unaffected by this card's effect. - Other various small fixes and updates.
1 parent 6eea0fb commit 8cf5cf2

File tree

13 files changed

+270
-308
lines changed

13 files changed

+270
-308
lines changed

official/c45178472.lua

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
--Full House
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Destroy 2 other face-up Spells/Traps and 3 Set Spells/Traps on the field
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_DESTROY)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
9-
e1:SetCode(EVENT_FREE_CHAIN)
10-
e1:SetHintTiming(0,TIMING_END_PHASE)
1110
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1213
e1:SetTarget(s.target)
1314
e1:SetOperation(s.activate)
1415
c:RegisterEffect(e1)
1516
end
16-
function s.up(c)
17-
return c:IsFaceup() and c:IsSpellTrap()
17+
function s.desfilter(c,e)
18+
return c:IsSpellTrap() and c:IsCanBeEffectTarget(e)
1819
end
19-
function s.down(c)
20-
return c:IsFacedown() and c:IsSpellTrap()
20+
function s.rescon(sg,e,tp,mg)
21+
return sg:IsExists(Card.IsFaceup,2,nil) and sg:IsExists(Card.IsFacedown,3,nil)
2122
end
2223
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
2324
if chkc then return false end
24-
if chk==0 then return Duel.IsExistingTarget(s.up,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,e:GetHandler())
25-
and Duel.IsExistingTarget(s.down,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,3,e:GetHandler()) end
26-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
27-
local g1=Duel.SelectTarget(tp,s.up,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,e:GetHandler())
28-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
29-
local g2=Duel.SelectTarget(tp,s.down,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,3,3,e:GetHandler())
30-
g1:Merge(g2)
31-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,5,0,0)
25+
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e)
26+
if chk==0 then return aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,0) end
27+
local tg=aux.SelectUnselectGroup(g,e,tp,5,5,s.rescon,1,tp,HINTMSG_DESTROY)
28+
Duel.SetTargetCard(tg)
29+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,5,tp,0)
3230
end
3331
function s.activate(e,tp,eg,ep,ev,re,r,rp)
34-
local g=Duel.GetTargetCards(e)
35-
Duel.Destroy(g,REASON_EFFECT)
32+
local tg=Duel.GetTargetCards(e)
33+
if #tg>0 then
34+
Duel.Destroy(tg,REASON_EFFECT)
35+
end
3636
end

official/c48152161.lua

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,48 @@
22
--The Sanctified Darklord
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Negate the effects of 1 Effect Monster on the field until the end of this turn, and if you do, gain LP equal to its ATK
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_FREE_CHAIN)
1011
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
12+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1113
e1:SetCost(s.cost)
1214
e1:SetTarget(s.target)
1315
e1:SetOperation(s.activate)
1416
c:RegisterEffect(e1)
1517
end
1618
s.listed_series={SET_DARKLORD}
1719
function s.costfilter(c)
18-
return c:IsSetCard(SET_DARKLORD)
19-
and c:IsMonster() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
20-
and Duel.IsExistingMatchingCard(s.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
20+
return c:IsSetCard(SET_DARKLORD) and c:IsMonster() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
21+
and Duel.IsExistingMatchingCard(s.disfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
22+
end
23+
function s.disfilter(c)
24+
return c:IsNegatableMonster() and c:IsType(TYPE_EFFECT)
2125
end
2226
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2327
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end
2428
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
2529
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil)
2630
Duel.SendtoGrave(g,REASON_COST)
2731
end
28-
function s.filter(c)
29-
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
30-
end
3132
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
32-
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
33-
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
33+
if chk==0 then return Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
34+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,tp,0)
3435
end
3536
function s.activate(e,tp,eg,ep,ev,re,r,rp)
36-
local exc=nil
37-
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
38-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
39-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,exc)
40-
if #g>0 then
41-
local tc=g:GetFirst()
42-
local e1=Effect.CreateEffect(e:GetHandler())
43-
e1:SetType(EFFECT_TYPE_SINGLE)
44-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
45-
e1:SetCode(EFFECT_DISABLE)
46-
e1:SetReset(RESETS_STANDARD_PHASE_END)
47-
tc:RegisterEffect(e1)
48-
local e2=Effect.CreateEffect(e:GetHandler())
49-
e2:SetType(EFFECT_TYPE_SINGLE)
50-
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
51-
e2:SetCode(EFFECT_DISABLE_EFFECT)
52-
e2:SetValue(RESET_TURN_SET)
53-
e2:SetReset(RESETS_STANDARD_PHASE_END)
54-
tc:RegisterEffect(e2)
55-
Duel.AdjustInstantly(tc)
56-
local atk=tc:GetAttack()
57-
if not tc:IsImmuneToEffect(e1) and not tc:IsImmuneToEffect(e2) and atk>0 then
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
38+
local sc=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
39+
if not sc then return end
40+
Duel.HintSelection(sc)
41+
if sc:IsCanBeDisabledByEffect(e) then
42+
--Negate its effects until the end of the turn
43+
sc:NegateEffects(e:GetHandler(),RESETS_STANDARD_PHASE_END)
44+
Duel.AdjustInstantly(sc)
45+
local atk=sc:GetAttack()
46+
if atk>0 then
5847
Duel.Recover(tp,atk,REASON_EFFECT)
5948
end
6049
end

official/c4837861.lua

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,58 @@ local s,id=GetID()
55
function s.initial_effect(c)
66
c:EnableReviveLimit()
77
--Must first be Special Summoned (from your hand) by banishing 3 "Meklord" monsters with different names from your GY
8+
local e0=Effect.CreateEffect(c)
9+
e0:SetDescription(aux.Stringid(id,0))
10+
e0:SetType(EFFECT_TYPE_FIELD)
11+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
12+
e0:SetCode(EFFECT_SPSUMMON_PROC)
13+
e0:SetRange(LOCATION_HAND)
14+
e0:SetCondition(s.spcon)
15+
e0:SetTarget(s.sptg)
16+
e0:SetOperation(s.spop)
17+
c:RegisterEffect(e0)
18+
--Look at your opponent's Extra Deck and equip 1 monster from it to this card
819
local e1=Effect.CreateEffect(c)
9-
e1:SetDescription(aux.Stringid(id,0))
10-
e1:SetType(EFFECT_TYPE_FIELD)
11-
e1:SetCode(EFFECT_SPSUMMON_PROC)
12-
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
13-
e1:SetRange(LOCATION_HAND)
14-
e1:SetCondition(s.spcon)
15-
e1:SetTarget(s.sptg)
16-
e1:SetOperation(s.spop)
20+
e1:SetDescription(aux.Stringid(id,1))
21+
e1:SetCategory(CATEGORY_EQUIP)
22+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
23+
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
24+
e1:SetCountLimit(1)
25+
e1:SetTarget(s.eqtg)
26+
e1:SetOperation(s.eqop)
1727
c:RegisterEffect(e1)
18-
--Look at your opponent's Extra Deck and equip 1 monster from it to this card
28+
--This card gains ATK equal to the combined ATK of those equipped monsters
1929
local e2=Effect.CreateEffect(c)
20-
e2:SetDescription(aux.Stringid(id,1))
21-
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22-
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
23-
e2:SetCountLimit(1)
24-
e2:SetTarget(s.eqtg)
25-
e2:SetOperation(s.eqop)
30+
e2:SetType(EFFECT_TYPE_SINGLE)
31+
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
32+
e2:SetCode(EFFECT_UPDATE_ATTACK)
33+
e2:SetRange(LOCATION_MZONE)
34+
e2:SetValue(function(e,c) return e:GetHandler():GetEquipGroup():Filter(Card.HasFlagEffect,nil,id):GetSum(Card.GetAttack) end)
2635
c:RegisterEffect(e2)
27-
--Gains ATK equal to the combined ATK of the equipped monsters
36+
--While equipped with a Synchro Monster, this card can make up to 3 attacks on monsters during each Battle Phase
2837
local e3=Effect.CreateEffect(c)
2938
e3:SetType(EFFECT_TYPE_SINGLE)
30-
e3:SetCode(EFFECT_UPDATE_ATTACK)
3139
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
40+
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
3241
e3:SetRange(LOCATION_MZONE)
33-
e3:SetCondition(s.atkcon)
34-
e3:SetValue(s.atkval)
42+
e3:SetCondition(function(e) return e:GetHandler():GetEquipGroup():IsExists(Card.IsOriginalType,1,nil,TYPE_SYNCHRO) end)
43+
e3:SetValue(2)
3544
c:RegisterEffect(e3)
36-
--While equipped with a Synchro Monster, this card can make up to 3 attacks on monsters during each Battle Phase
37-
local e4=Effect.CreateEffect(c)
38-
e4:SetType(EFFECT_TYPE_SINGLE)
39-
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
40-
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
41-
e4:SetRange(LOCATION_MZONE)
42-
e4:SetCondition(s.extraatkcon)
43-
e4:SetValue(2)
44-
c:RegisterEffect(e4)
4545
end
4646
s.listed_series={SET_MEKLORD}
4747
function s.spcostfilter(c)
4848
return c:IsSetCard(SET_MEKLORD) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
4949
end
5050
function s.rescon(sg,e,tp,mg)
51-
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg
51+
return Duel.GetMZoneCount(tp,sg)>0 and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg
5252
end
5353
function s.spcon(e,c)
5454
if c==nil then return true end
5555
local tp=c:GetControler()
5656
local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
5757
return #rg>=2 and aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,0)
5858
end
59-
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
59+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
6060
local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
6161
local g=aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,1,tp,HINTMSG_REMOVE,nil,nil,true)
6262
if #g>0 then
@@ -86,30 +86,20 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp)
8686
local g=Duel.GetMatchingGroup(s.eqfilter,tp,0,LOCATION_EXTRA,nil,tp)
8787
if #g==0 then return end
8888
Duel.ConfirmCards(tp,Duel.GetFieldGroup(tp,0,LOCATION_EXTRA))
89+
if c:IsFacedown() then return Duel.ShuffleExtra(1-tp) end
8990
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
9091
local ec=g:Select(tp,1,1,nil):GetFirst()
92+
Duel.ShuffleExtra(1-tp)
9193
if ec and Duel.Equip(tp,ec,c,true) then
94+
ec:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
95+
--Equip limit
9296
local e1=Effect.CreateEffect(c)
9397
e1:SetType(EFFECT_TYPE_SINGLE)
98+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
9499
e1:SetCode(EFFECT_EQUIP_LIMIT)
100+
e1:SetValue(function(e,_c) return _c==c end)
95101
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
96-
e1:SetValue(s.eqlimit)
97-
e1:SetLabelObject(c)
98102
ec:RegisterEffect(e1)
99-
ec:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
100-
Duel.ShuffleExtra(1-tp)
101103
end
102104
end
103-
end
104-
function s.eqlimit(e,c)
105-
return c==e:GetLabelObject()
106-
end
107-
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
108-
return e:GetHandler():GetEquipGroup():IsExists(Card.HasFlagEffect,1,nil,id)
109-
end
110-
function s.atkval(e,c)
111-
return e:GetHandler():GetEquipGroup():Filter(Card.HasFlagEffect,nil,id):GetSum(Card.GetAttack)
112-
end
113-
function s.extraatkcon(e,tp,eg,ep,ev,re,r,rp)
114-
return e:GetHandler():GetEquipGroup():IsExists(Card.IsOriginalType,1,nil,TYPE_SYNCHRO)
115105
end

official/c48783998.lua

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,35 @@
22
--Nova Summoner
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--special summon
5+
--Special Summon 1 LIGHT Fairy monster with 1500 or less ATK from your Deck, or, if "The Sanctuary in the Sky" is on the field, you can Special Summon 1 "Airknight Parshath" instead
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
99
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
1010
e1:SetCode(EVENT_BATTLE_DESTROYED)
11-
e1:SetCondition(s.condition)
12-
e1:SetTarget(s.target)
13-
e1:SetOperation(s.operation)
11+
e1:SetCondition(function(e) return e:GetHandler():IsLocation(LOCATION_GRAVE) end)
12+
e1:SetTarget(s.sptg)
13+
e1:SetOperation(s.spop)
1414
c:RegisterEffect(e1)
1515
end
16-
s.listed_names={18036057,CARD_SANCTUARY_SKY}
17-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
18-
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
19-
end
20-
function s.filter1(c,e,tp)
21-
return c:IsAttackBelow(1500) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY)
22-
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
23-
end
24-
function s.filter2(c,e,tp)
25-
return (c:IsCode(18036057) or (c:IsAttackBelow(1500) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY)))
16+
s.listed_names={CARD_SANCTUARY_SKY,18036057} --"Airknight Parshath"
17+
function s.spfilter(c,e,tp,sanctuary_chk)
18+
return ((c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and c:IsAttackBelow(1500)) or (sanctuary_chk and c:IsCode(18036057)))
2619
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
2720
end
28-
function s.envfilter(c)
29-
return c:IsFaceup() and c:IsCode(CARD_SANCTUARY_SKY)
30-
end
31-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
21+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
3222
if chk==0 then
3323
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
34-
if not (Duel.IsExistingMatchingCard(s.envfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsEnvironment(CARD_SANCTUARY_SKY)) then
35-
return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_DECK,0,1,nil,e,tp)
36-
else
37-
return Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,e,tp)
38-
end
24+
local sanctuary_chk=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_SANCTUARY_SKY),0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsEnvironment(CARD_SANCTUARY_SKY)
25+
return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,sanctuary_chk)
3926
end
4027
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
4128
end
42-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
29+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4330
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
44-
local g=nil
31+
local sanctuary_chk=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_SANCTUARY_SKY),0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsEnvironment(CARD_SANCTUARY_SKY)
4532
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
46-
if not (Duel.IsExistingMatchingCard(s.envfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsEnvironment(CARD_SANCTUARY_SKY)) then
47-
g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
48-
else
49-
g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
50-
end
33+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,sanctuary_chk)
5134
if #g>0 then
5235
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
5336
end

official/c49633574.lua

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,37 @@
22
--Fabled Oltro
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--special summon
5+
--Special Summon 1 Level 3 "Fabled" monster from your hand
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
99
e1:SetType(EFFECT_TYPE_IGNITION)
10-
e1:SetCountLimit(1)
1110
e1:SetRange(LOCATION_MZONE)
12-
e1:SetTarget(s.tg)
13-
e1:SetOperation(s.op)
11+
e1:SetCountLimit(1)
12+
e1:SetCost(s.spcost)
13+
e1:SetTarget(s.sptg)
14+
e1:SetOperation(s.spop)
1415
c:RegisterEffect(e1)
1516
end
1617
s.listed_series={SET_FABLED}
18+
function s.spcostfilter(c,e,tp)
19+
return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c,e,tp)
20+
end
1721
function s.spfilter(c,e,tp)
18-
return c:IsSetCard(SET_FABLED) and c:IsMonster() and c:GetLevel()==3 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
22+
return c:IsLevel(3) and c:IsSetCard(SET_FABLED) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
1923
end
20-
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
21-
if chk==0 then
22-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
23-
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
24-
local res=nil
25-
if #g==0 then
26-
res=false
27-
elseif #g==1 then
28-
res=Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,g:GetFirst())
29-
else res=Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
30-
return res
31-
end
32-
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
33-
local cg=nil
24+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
25+
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
3426
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
35-
if #g==1 then
36-
cg=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,g:GetFirst())
37-
else cg=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) end
38-
Duel.SendtoGrave(cg,REASON_COST)
27+
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
28+
Duel.SendtoGrave(g,REASON_COST)
29+
end
30+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
31+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
32+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
3933
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
4034
end
41-
function s.op(e,tp,eg,ep,ev,re,r,rp)
35+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4236
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
4337
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
4438
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)

0 commit comments

Comments
 (0)