Skip to content

Commit f566662

Browse files
authored
Various script fixes
- Crevice Into the Different Dimension: Simplified the way the available Attributes are calculated. - Crop Circles: Updated the selection process for the cost to be more in line with how the card works (e.g. you don't choose a valid "Alien" monster in your Deck on activation). - Crystal Conclave: Should check that the destroyed card was a "Crystal Beast" monster on the field specifically, not after it's destroyed. - Underground Arachnid: Shouldn't equip the target if it's face-down or the opponent doesn't control it anymore on resolution. - Various other small fixes and updates.
1 parent 6ebd2bd commit f566662

14 files changed

Lines changed: 295 additions & 375 deletions

‎official/c24082387.lua‎

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,57 @@
22
--Crop Circles
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Special Summon 1 "Alien" monster from your Deck whose Level is equal to the total original Levels of the monsters sent to the GY to activate this card
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_FREE_CHAIN)
10-
e1:SetHintTiming(0,TIMING_END_PHASE)
11-
e1:SetLabel(0)
1211
e1:SetCost(s.cost)
1312
e1:SetTarget(s.target)
1413
e1:SetOperation(s.activate)
14+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1515
c:RegisterEffect(e1)
1616
end
1717
s.listed_series={SET_ALIEN}
18-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
19-
e:SetLabel(100)
20-
return true
18+
function s.costfilter(c)
19+
return c:HasLevel() and c:IsAbleToGraveAsCost() and c:IsMonsterCard()
2120
end
22-
function s.filter1(c,e,tp,cg,minc)
23-
return c:IsSetCard(SET_ALIEN) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
24-
and cg:CheckWithSumEqual(Card.GetLevel,c:GetLevel(),minc,99)
21+
function s.rescon(sg,e,tp,mg)
22+
return Duel.GetMZoneCount(tp,sg)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,sg:GetSum(Card.GetOriginalLevel))
2523
end
26-
function s.cgfilter(c)
27-
return c:HasLevel() and c:IsAbleToGraveAsCost() and c:IsMonsterCard()
24+
function s.spfilter(c,e,tp,lv)
25+
return c:IsSetCard(SET_ALIEN) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
26+
end
27+
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
28+
e:SetLabel(-100)
29+
local cg=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_MZONE,0,nil)
30+
if chk==0 then return #cg>0 and aux.SelectUnselectGroup(cg,e,tp,1,#cg,s.rescon,0) end
31+
local g=aux.SelectUnselectGroup(cg,e,tp,1,#cg,s.rescon,1,tp,HINTMSG_TOGRAVE,s.rescon)
32+
Duel.SendtoGrave(g,REASON_COST)
33+
e:SetLabel(g:GetSum(Card.GetOriginalLevel))
2834
end
2935
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
30-
local cg=Duel.GetMatchingGroup(s.cgfilter,tp,LOCATION_MZONE,0,nil)
31-
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
32-
local minc=-ft+1
33-
if minc<=0 then minc=1 end
3436
if chk==0 then
35-
if e:GetLabel()~=100 then return false end
37+
local res=e:GetLabel()==-100
3638
e:SetLabel(0)
37-
return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_DECK,0,1,nil,e,tp,cg,minc)
39+
return res
3840
end
39-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
40-
local rg=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,cg,minc)
41-
e:SetLabel(rg:GetFirst():GetLevel())
42-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
43-
local sg=cg:SelectWithSumEqual(tp,Card.GetLevel,e:GetLabel(),minc,99)
44-
Duel.SendtoGrave(sg,REASON_COST)
41+
Duel.SetTargetParam(e:GetLabel())
42+
e:SetLabel(0)
4543
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
46-
end
47-
function s.filter2(c,e,tp,lv)
48-
return c:IsSetCard(SET_ALIEN) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
44+
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
4945
end
5046
function s.activate(e,tp,eg,ep,ev,re,r,rp)
51-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then Duel.Damage(tp,2000,REASON_EFFECT) return end
52-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
53-
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
54-
if #g>0 then
55-
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
56-
else Duel.Damage(tp,2000,REASON_EFFECT) end
47+
local sp_chk=0
48+
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
50+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM))
51+
if #g>0 then
52+
sp_chk=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
53+
end
54+
end
55+
if sp_chk==0 then
56+
Duel.Damage(tp,2000,REASON_EFFECT)
57+
end
5758
end

‎official/c24508238.lua‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
--D.D.クロウ
1+
--D.D.クロウ
22
--D.D. Crow
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Banish 1 target from the GY
5+
--Banish 1 card from your opponent's GY
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_REMOVE)
9-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
109
e1:SetType(EFFECT_TYPE_QUICK_O)
11-
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_ATTACK)
10+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1211
e1:SetCode(EVENT_FREE_CHAIN)
1312
e1:SetRange(LOCATION_HAND)
1413
e1:SetCost(Cost.SelfDiscardToGrave)
15-
e1:SetTarget(s.target)
16-
e1:SetOperation(s.operation)
14+
e1:SetTarget(s.rmtg)
15+
e1:SetOperation(s.rmop)
16+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1717
c:RegisterEffect(e1)
1818
end
19-
function s.rmfilter(c)
20-
return c:IsAbleToRemove() and aux.SpElimFilter(c)
21-
end
22-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
23-
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.rmfilter(chkc) end
24-
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end
19+
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
20+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
21+
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
2522
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
26-
local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil)
27-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
23+
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
24+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
2825
end
29-
function s.operation(e,tp,eg,ep,ev,re,r,rp,chk)
26+
function s.rmop(e,tp,eg,ep,ev,re,r,rp,chk)
3027
local tc=Duel.GetFirstTarget()
31-
if tc and tc:IsRelateToEffect(e) then
28+
if tc:IsRelateToEffect(e) then
3229
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
3330
end
3431
end

‎official/c24623598.lua‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
--Disappear
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Banish 1 card from your opponent's GY
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_REMOVE)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1011
e1:SetCode(EVENT_FREE_CHAIN)
1112
e1:SetTarget(s.target)
1213
e1:SetOperation(s.activate)
14+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1315
c:RegisterEffect(e1)
1416
end
15-
function s.rmfilter(c)
16-
return c:IsAbleToRemove() and aux.SpElimFilter(c)
17-
end
1817
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
19-
if chkc then return chkc:GetControler()~=tp and chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.rmfilter(chkc) end
20-
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end
18+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
19+
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
2120
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
22-
local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil)
23-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
21+
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
22+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
2423
end
2524
function s.activate(e,tp,eg,ep,ev,re,r,rp,chk)
2625
local tc=Duel.GetFirstTarget()

‎official/c44656450.lua‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--Condemned Witch
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--search
5+
--Add 1 "Forbidden" Quick-Play Spell from your Deck to your hand
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
@@ -12,25 +12,25 @@ function s.initial_effect(c)
1212
e1:SetTarget(s.thtg)
1313
e1:SetOperation(s.thop)
1414
c:RegisterEffect(e1)
15-
--special summon
15+
--Special Summon 1 Level 4 Fairy monster from your Deck, except "Condemned Witch"
1616
local e2=Effect.CreateEffect(c)
1717
e2:SetDescription(aux.Stringid(id,1))
1818
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
1919
e2:SetType(EFFECT_TYPE_QUICK_O)
2020
e2:SetCode(EVENT_FREE_CHAIN)
21-
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
2221
e2:SetRange(LOCATION_MZONE)
2322
e2:SetCountLimit(1,{id,1})
24-
e2:SetCondition(s.spcon)
23+
e2:SetCondition(function(e,tp) return Duel.IsMainPhase(1-tp) end)
2524
e2:SetCost(Cost.SelfTribute)
2625
e2:SetTarget(s.sptg)
2726
e2:SetOperation(s.spop)
27+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
2828
c:RegisterEffect(e2)
2929
end
3030
s.listed_series={SET_FORBIDDEN}
3131
s.listed_names={id}
3232
function s.thfilter(c)
33-
return (c:IsSetCard(SET_FORBIDDEN) or c:IsCode(25789292,27243130,54773234,96864811)) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
33+
return c:IsSetCard(SET_FORBIDDEN) and c:IsQuickPlaySpell() and c:IsAbleToHand()
3434
end
3535
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
3636
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
@@ -44,9 +44,6 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
4444
Duel.ConfirmCards(1-tp,g)
4545
end
4646
end
47-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
48-
return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase()
49-
end
5047
function s.spfilter(c,e,tp)
5148
return c:IsLevel(4) and c:IsRace(RACE_FAIRY) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
5249
end

‎official/c49600724.lua‎

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,35 @@
22
--Crevice Into the Different Dimension
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Banish 2 monsters from either GY with the declared Attribute
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_REMOVE)
8-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
99
e1:SetType(EFFECT_TYPE_ACTIVATE)
10+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1011
e1:SetCode(EVENT_FREE_CHAIN)
1112
e1:SetTarget(s.target)
1213
e1:SetOperation(s.activate)
14+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
1315
c:RegisterEffect(e1)
1416
end
15-
function s.filter(c,e)
16-
return c:IsMonster() and c:IsCanBeEffectTarget(e) and c:IsAbleToRemove() and aux.SpElimFilter(c,true)
17-
end
18-
function s.filter1(c,g)
19-
return g:IsExists(Card.IsAttribute,1,c,c:GetAttribute())
17+
function s.rmfilter(c,e,opp)
18+
return c:IsMonster() and c:IsAbleToRemove() and c:IsCanBeEffectTarget(e) and (c:IsControler(opp) or aux.SpElimFilter(c,true))
2019
end
2120
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
22-
if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and s.filter(chkc,e) end
23-
if chk==0 then
24-
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,nil,e)
25-
return g:IsExists(s.filter1,1,nil,g)
26-
end
27-
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,nil,e)
28-
local rg=g:Filter(s.filter1,nil,g)
29-
local tc=rg:GetFirst()
30-
local att=0
31-
for tc in aux.Next(rg) do
32-
att=(att|tc:GetAttribute())
33-
end
34-
local ac=Duel.AnnounceAttribute(tp,1,att)
21+
if chkc then return false end
22+
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_GRAVE,nil,e,1-tp)
23+
if chk==0 then return #g>=2 and g:GetClassCount(Card.GetAttribute)<#g end
24+
local available_attributes=g:GetBitwiseOr(function(c) local attr=c:GetAttribute() return g:IsExists(Card.IsAttribute,1,c,attr) and attr or 0 end)
25+
local attr=Duel.AnnounceAttribute(tp,1,available_attributes)
3526
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
36-
local sg=rg:FilterSelect(tp,Card.IsAttribute,2,2,nil,ac)
37-
Duel.SetTargetCard(sg)
38-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,2,0,0)
27+
local tg=g:FilterSelect(tp,Card.IsAttribute,2,2,nil,attr)
28+
Duel.SetTargetCard(tg)
29+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,2,tp,0)
3930
end
4031
function s.activate(e,tp,eg,ep,ev,re,r,rp)
41-
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
42-
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
43-
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
32+
local tg=Duel.GetTargetCards(e)
33+
if #tg>0 then
34+
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
35+
end
4436
end

‎official/c63465535.lua‎

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
--Underground Arachnid
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--synchro summon
6-
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_INSECT),1,1)
75
c:EnableReviveLimit()
8-
--actlimit
6+
--Synchro Summon procedure: 1 DARK Tuner + 1 non-Tuner Insect monster
7+
Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_DARK),1,1,Synchro.NonTunerEx(Card.IsRace,RACE_INSECT),1,1)
8+
--If this card attacks, your opponent cannot activate Spells/Traps until the end of the Damage Step
99
local e1=Effect.CreateEffect(c)
1010
e1:SetType(EFFECT_TYPE_FIELD)
1111
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
1212
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
1313
e1:SetRange(LOCATION_MZONE)
1414
e1:SetTargetRange(0,1)
15-
e1:SetValue(s.aclimit)
16-
e1:SetCondition(s.actcon)
15+
e1:SetCondition(function(e) return Duel.GetAttacker()==e:GetHandler() end)
16+
e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
1717
c:RegisterEffect(e1)
18-
--equip
18+
--Equip 1 opponent's face-up monster to this card (only 1 monster can be equipped to this card with this effect)
1919
local e2=Effect.CreateEffect(c)
2020
e2:SetDescription(aux.Stringid(id,0))
2121
e2:SetCategory(CATEGORY_EQUIP)
@@ -27,60 +27,43 @@ function s.initial_effect(c)
2727
e2:SetTarget(s.eqtg)
2828
e2:SetOperation(s.eqop)
2929
c:RegisterEffect(e2)
30-
aux.AddEREquipLimit(c,s.eqcon,function(ec,_,tp) return ec:IsControler(1-tp) end,s.equipop,e2)
31-
--Destroy replace
30+
aux.AddEREquipLimit(c,s.eqcon,function(ec,c,tp) return ec:IsControler(1-tp) end,function(c,e,tp,tc) c:EquipByEffectAndLimitRegister(e,tp,tc,id) end,e2)
31+
--If this card would be destroyed by battle, you can destroy that equipped monster instead
3232
local e3=Effect.CreateEffect(c)
33-
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
33+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
3434
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
35-
e3:SetRange(LOCATION_MZONE)
3635
e3:SetCode(EFFECT_DESTROY_REPLACE)
36+
e3:SetRange(LOCATION_MZONE)
3737
e3:SetTarget(s.desreptg)
3838
e3:SetOperation(s.desrepop)
39-
e3:SetLabelObject(e2)
4039
c:RegisterEffect(e3)
4140
end
42-
function s.aclimit(e,re,tp)
43-
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
44-
end
45-
function s.actcon(e)
46-
return Duel.GetAttacker()==e:GetHandler()
47-
end
4841
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
49-
local g=e:GetHandler():GetEquipGroup():Filter(s.eqfilter,nil)
50-
return #g==0
51-
end
52-
function s.eqfilter(c)
53-
return c:GetFlagEffect(id)~=0
54-
end
55-
function s.filter(c)
56-
return c:IsFaceup() and c:IsAbleToChangeControler()
42+
return not e:GetHandler():GetEquipGroup():IsExists(Card.HasFlagEffect,1,nil,id)
5743
end
5844
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
59-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end
45+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() and chkc:IsFaceup() end
6046
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
61-
and Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end
47+
and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,1,nil) end
6248
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
63-
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
64-
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
65-
end
66-
function s.equipop(c,e,tp,tc)
67-
c:EquipByEffectAndLimitRegister(e,tp,tc,id)
49+
local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAbleToChangeControler),tp,0,LOCATION_MZONE,1,1,nil)
50+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0)
6851
end
6952
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
70-
local c=e:GetHandler()
7153
local tc=Duel.GetFirstTarget()
72-
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsMonster() then
73-
s.equipop(c,e,tp,tc)
54+
if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and tc:IsFaceup() and tc:IsMonster() then
55+
e:GetHandler():EquipByEffectAndLimitRegister(e,tp,tc,id)
7456
end
7557
end
58+
function s.desrepfilter(c,e)
59+
return c:HasFlagEffect(id) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
60+
end
7661
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
7762
local c=e:GetHandler()
78-
local ec=c:GetEquipGroup():Filter(s.eqfilter,nil):GetFirst()
79-
if chk==0 then return c:IsReason(REASON_BATTLE) and ec and ec:IsHasCardTarget(c)
80-
and ec:IsDestructable(e) and not ec:IsStatus(STATUS_DESTROY_CONFIRMED) end
63+
if chk==0 then return c:IsReason(REASON_BATTLE) and c:GetEquipGroup():IsExists(s.desrepfilter,1,nil,e) end
8164
return Duel.SelectEffectYesNo(tp,c,96)
8265
end
8366
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
84-
local ec=e:GetHandler():GetEquipGroup():Filter(s.eqfilter,nil):GetFirst()
67+
local ec=e:GetHandler():GetEquipGroup():Match(s.desrepfilter,nil,e)
8568
Duel.Destroy(ec,REASON_EFFECT|REASON_REPLACE)
8669
end

0 commit comments

Comments
 (0)