Skip to content

Commit 1f9b77d

Browse files
committed
update "Fire Fist" monsters
use `EFFECT_COST_REPLACE` and `Cost.Replaceable` to handle the effect of "Brotherhood of the Fire Fist - Eagle" that lets "Fire Fist" monsters skip their cost
1 parent 07eceeb commit 1f9b77d

13 files changed

Lines changed: 132 additions & 186 deletions

official/c20265095.lua

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,40 @@ function s.initial_effect(c)
2525
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
2626
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
2727
e2:SetCountLimit(1,id)
28+
e2:SetCost(Cost.Replaceable(s.ctcost,s.extracon))
2829
e2:SetTarget(s.cttg)
2930
e2:SetOperation(s.ctop)
3031
c:RegisterEffect(e2)
3132
end
32-
--Lists "Fire Fist" archetype
3333
s.listed_series={SET_FIRE_FORMATION,SET_FIRE_FIST}
34-
--If this card is pointing to "Fire Fist"
3534
function s.lkfilter(c)
3635
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FIST) and c:IsMonster()
3736
end
3837
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
3938
return e:GetHandler():GetLinkedGroup():IsExists(s.lkfilter,1,nil)
4039
end
41-
--Check for "Fire Formation" S/T for cost
42-
function s.ctfilter(c)
40+
function s.ctcostfilter(c,tp,zones)
4341
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
42+
and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL,zones)>0
43+
end
44+
function s.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
45+
local zones=e:GetHandler():GetLinkedZone()&ZONES_MMZ
46+
if chk==0 then return Duel.IsExistingMatchingCard(s.ctcostfilter,tp,LOCATION_ONFIELD,0,1,nil,tp,zones) end
47+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
48+
local g=Duel.SelectMatchingCard(tp,s.ctcostfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp,zones)
49+
Duel.SendtoGrave(g,REASON_COST)
50+
end
51+
function s.extracon(base,e,tp)
52+
local zones=e:GetHandler():GetLinkedZone()&ZONES_MMZ
53+
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zones)>0
4454
end
45-
--Activation legality
4655
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
47-
local c=e:GetHandler()
48-
local zone=c:GetLinkedZone()&ZONES_MMZ
49-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged(false,zone) end
50-
local nc=Duel.IsExistingMatchingCard(s.ctfilter,tp,LOCATION_ONFIELD,0,1,nil)
51-
local tgchk=Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil,false,zone)
52-
if chk==0 then
53-
if Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) then
54-
return tgchk
55-
else return nc and tgchk end
56-
end
57-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
58-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
59-
local g1=Duel.SelectMatchingCard(tp,s.ctfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
60-
Duel.SendtoGrave(g1,REASON_COST)
61-
end
56+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
57+
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
6258
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
63-
local g2=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil,false,zone)
64-
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g2,1,0,0)
59+
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
60+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
6561
end
66-
--Take control of opponent's monster until end phase, it cannot attack
6762
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
6863
local tc=Duel.GetFirstTarget()
6964
local c=e:GetHandler()
@@ -80,4 +75,4 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
8075
tc:RegisterEffect(e1)
8176
end
8277
end
83-
end
78+
end

official/c30929786.lua

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ function s.initial_effect(c)
2121
e2:SetType(EFFECT_TYPE_IGNITION)
2222
e2:SetRange(LOCATION_MZONE)
2323
e2:SetCountLimit(1)
24-
e2:SetCost(s.setcost)
24+
e2:SetCost(Cost.Replaceable(s.setcost,s.extracon))
25+
e2:SetTarget(s.settg)
2526
e2:SetOperation(s.setop)
2627
c:RegisterEffect(e2)
2728
end
@@ -44,28 +45,32 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
4445
Duel.ConfirmCards(1-tp,g)
4546
end
4647
end
47-
function s.cfilter(c,tp)
48-
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
49-
and ((c:GetSequence()<5 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,true))
50-
or (c:GetSequence()>4 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)))
48+
function s.setfilter(c,field)
49+
return c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsSSetable(not field)
5150
end
52-
function s.filter(c,ignore)
53-
return c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsSSetable(ignore)
51+
function s.setcostfilter(c,tp,has_zone)
52+
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
53+
--needs S/T equivalent of Duel.GetMZoneCount for proper handling
54+
and (has_zone or c:IsLocation(LOCATION_STZONE) or Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,true))
5455
end
5556
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
56-
local nc=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
57-
if chk==0 then return nc or (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)) end
58-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
59-
and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
60-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
61-
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
62-
Duel.SendtoGrave(g,REASON_COST)
63-
end
57+
local has_zone=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
58+
if chk==0 then return Duel.IsExistingMatchingCard(s.setcostfilter,tp,LOCATION_ONFIELD,0,1,nil,tp,has_zone) end
59+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
60+
local g=Duel.SelectMatchingCard(tp,s.setcostfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp,has_zone)
61+
Duel.SendtoGrave(g,REASON_COST)
62+
end
63+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
64+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
65+
end
66+
function s.extracon(base,e,tp)
67+
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
68+
or Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,true)
6469
end
6570
function s.setop(e,tp,eg,ep,ev,re,r,rp)
6671
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
67-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
72+
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,Duel.GetLocationCount(tp,LOCATION_SZONE)==0)
6873
if #g>0 then
6974
Duel.SSet(tp,g:GetFirst())
7075
end
71-
end
76+
end

official/c43748308.lua

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function s.initial_effect(c)
2323
e3:SetType(EFFECT_TYPE_IGNITION)
2424
e3:SetRange(LOCATION_MZONE)
2525
e3:SetCountLimit(1)
26-
e3:SetCost(s.spcost)
26+
e3:SetCost(Cost.Replaceable(s.spcost,function(_,_,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end))
2727
e3:SetTarget(s.sptg)
2828
e3:SetOperation(s.spop)
2929
c:RegisterEffect(e3)
@@ -50,21 +50,14 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
5050
Duel.SSet(tp,g:GetFirst())
5151
end
5252
end
53-
function s.cfilter(c)
53+
function s.spcostfilter(c)
5454
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
5555
end
5656
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
57-
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_ONFIELD,0,nil)
58-
local nc=Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g>1 and aux.SelectUnselectGroup(g,e,tp,2,2,aux.ChkfMMZ(1),0)
59-
if chk==0 then
60-
if Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) then
61-
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
62-
else return nc end
63-
end
64-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
65-
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_TOGRAVE)
66-
Duel.SendtoGrave(sg,REASON_COST)
67-
end
57+
local g=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_ONFIELD,0,nil)
58+
if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,aux.ChkfMMZ(1),0) end
59+
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_TOGRAVE)
60+
Duel.SendtoGrave(sg,REASON_COST)
6861
end
6962
function s.spfilter(c,e,tp)
7063
return c:IsSetCard(SET_FIRE_FIST) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
@@ -81,4 +74,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
8174
if tc and tc:IsRelateToEffect(e) then
8275
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
8376
end
84-
end
77+
end

official/c46241344.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ function s.initial_effect(c)
88
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_BEASTWARRIOR),2,2)
99
--negate cost
1010
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
1112
e1:SetType(EFFECT_TYPE_FIELD)
12-
e1:SetCode(id)
1313
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
14+
e1:SetCode(EFFECT_COST_REPLACE)
1415
e1:SetRange(LOCATION_MZONE)
1516
e1:SetTargetRange(1,0)
17+
e1:SetValue(s.repval)
1618
c:RegisterEffect(e1)
1719
--to hand
1820
local e2=Effect.CreateEffect(c)
@@ -27,6 +29,10 @@ function s.initial_effect(c)
2729
c:RegisterEffect(e2)
2830
end
2931
s.listed_series={SET_FIRE_FORMATION,SET_FIRE_FIST}
32+
function s.repval(base,extracon,e,...)
33+
local c=e:GetHandler()
34+
return c:IsSetCard(SET_FIRE_FIST) and c:IsMonster() and extracon(base,e,...)
35+
end
3036
function s.thfilter(c)
3137
return c:IsSpellTrap() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsAbleToHand()
3238
and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
@@ -53,4 +59,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5359
Duel.SendtoGrave(g,REASON_EFFECT)
5460
end
5561
end
56-
end
62+
end

official/c61472381.lua

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function s.initial_effect(c)
2525
e2:SetRange(LOCATION_MZONE)
2626
e2:SetCountLimit(1,{id,1})
2727
e2:SetCondition(s.negcon)
28-
e2:SetCost(s.negcost)
28+
e2:SetCost(Cost.Replaceable(s.negcost))
2929
e2:SetTarget(s.negtg)
3030
e2:SetOperation(s.negop)
3131
c:RegisterEffect(e2)
@@ -54,26 +54,21 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
5454
end
5555
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
5656
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
57-
and ep~=tp and re:IsMonsterEffect() and Duel.IsChainDisablable(ev)
57+
and ep==1-tp and re:IsMonsterEffect() and Duel.IsChainDisablable(ev)
5858
end
59-
function s.cfilter(c)
60-
return c:IsFaceup() and (c:IsSetCard(SET_FIRE_FIST) or c:IsSetCard(SET_FIRE_FORMATION)) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
59+
function s.negcostfilter(c)
60+
return c:IsFaceup() and c:IsSetCard({SET_FIRE_FIST,SET_FIRE_FORMATION}) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
6161
end
6262
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
63-
local nc=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
64-
if chk==0 then
65-
if Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) then return true else return nc end
66-
end
67-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
68-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
69-
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
70-
Duel.SendtoGrave(g,REASON_COST)
71-
end
63+
if chk==0 then return Duel.IsExistingMatchingCard(s.negcostfilter,tp,LOCATION_ONFIELD,0,1,nil) end
64+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
65+
local g=Duel.SelectMatchingCard(tp,s.negcostfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
66+
Duel.SendtoGrave(g,REASON_COST)
7267
end
7368
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
7469
if chk==0 then return true end
7570
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
7671
end
7772
function s.negop(e,tp,eg,ep,ev,re,r,rp)
7873
Duel.NegateEffect(ev)
79-
end
74+
end

official/c6353603.lua

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function s.initial_effect(c)
2121
e2:SetType(EFFECT_TYPE_IGNITION)
2222
e2:SetRange(LOCATION_MZONE)
2323
e2:SetCountLimit(1)
24+
e2:SetCost(Cost.Replaceable(s.descost))
2425
e2:SetTarget(s.destg)
2526
e2:SetOperation(s.desop)
2627
c:RegisterEffect(e2)
@@ -42,30 +43,26 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
4243
Duel.SSet(tp,g:GetFirst())
4344
end
4445
end
45-
function s.filter1(c)
46+
function s.descostfilter(c)
4647
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
47-
and Duel.IsExistingTarget(aux.TRUE,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
48+
and Duel.IsExistingTarget(nil,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
49+
end
50+
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.descostfilter,tp,LOCATION_ONFIELD,0,1,nil) end
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
53+
local g=Duel.SelectMatchingCard(tp,s.descostfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
54+
Duel.SendtoGrave(g,REASON_COST)
4855
end
4956
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
5057
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
51-
local nc=Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_ONFIELD,0,1,nil)
52-
if chk==0 then
53-
if Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) then
54-
return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
55-
else return nc end
56-
end
57-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
58-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
59-
local g1=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_ONFIELD,0,1,1,nil)
60-
Duel.SendtoGrave(g1,REASON_COST)
61-
end
58+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
6259
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
63-
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
64-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g2,1,0,0)
60+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
61+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
6562
end
6663
function s.desop(e,tp,eg,ep,ev,re,r,rp)
6764
local tc=Duel.GetFirstTarget()
6865
if tc:IsRelateToEffect(e) then
6966
Duel.Destroy(tc,REASON_EFFECT)
7067
end
71-
end
68+
end

official/c70355994.lua

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function s.initial_effect(c)
2121
e2:SetType(EFFECT_TYPE_IGNITION)
2222
e2:SetRange(LOCATION_MZONE)
2323
e2:SetCountLimit(1)
24-
e2:SetCost(s.descost)
24+
e2:SetCost(Cost.Replaceable(s.descost))
2525
e2:SetTarget(s.destg)
2626
e2:SetOperation(s.desop)
2727
c:RegisterEffect(e2)
@@ -45,32 +45,26 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
4545
Duel.SSet(tp,g:GetFirst())
4646
end
4747
end
48-
function s.filter1(c)
48+
function s.descostfilter(c)
4949
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
50-
and Duel.IsExistingTarget(s.filter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
50+
and Duel.IsExistingTarget(Card.IsSpellTrap,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
5151
end
5252
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
53-
local nc=Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_ONFIELD,0,1,nil)
54-
if chk==0 then return nc or Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) end
55-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
56-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
57-
local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_ONFIELD,0,1,1,nil)
58-
Duel.SendtoGrave(g,REASON_COST)
59-
end
60-
end
61-
function s.filter2(c)
62-
return c:IsSpellTrap()
53+
if chk==0 then return Duel.IsExistingMatchingCard(s.descostfilter,tp,LOCATION_ONFIELD,0,1,nil) end
54+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
55+
local g=Duel.SelectMatchingCard(tp,s.descostfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
56+
Duel.SendtoGrave(g,REASON_COST)
6357
end
6458
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
65-
if chkc then return chkc:IsOnField() and s.filter2(chkc) end
66-
if chk==0 then return true end
59+
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
60+
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
6761
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
68-
local g2=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
69-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g2,1,0,0)
62+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
63+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
7064
end
7165
function s.desop(e,tp,eg,ep,ev,re,r,rp)
7266
local tc=Duel.GetFirstTarget()
7367
if tc:IsRelateToEffect(e) then
7468
Duel.Destroy(tc,REASON_EFFECT)
7569
end
76-
end
70+
end

official/c75132317.lua

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function s.initial_effect(c)
2424
e2:SetRange(LOCATION_MZONE)
2525
e2:SetCountLimit(1)
2626
e2:SetCondition(s.drcon)
27-
e2:SetCost(s.drcost)
27+
e2:SetCost(Cost.Replaceable(s.drcost))
2828
e2:SetTarget(s.drtg)
2929
e2:SetOperation(s.drop)
3030
c:RegisterEffect(e2)
@@ -54,17 +54,14 @@ end
5454
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
5555
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
5656
end
57-
function s.cfilter(c)
57+
function s.drcostfilter(c)
5858
return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsAbleToGraveAsCost()
5959
end
6060
function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
61-
local nc=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,2,nil)
62-
if chk==0 then return nc or Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) end
63-
if nc and not (Duel.IsPlayerAffectedByEffect(tp,CARD_FIRE_FIST_EAGLE) and Duel.SelectYesNo(tp,aux.Stringid(CARD_FIRE_FIST_EAGLE,0))) then
64-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
65-
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,2,2,nil)
66-
Duel.SendtoGrave(g,REASON_COST)
67-
end
61+
if chk==0 then return Duel.IsExistingMatchingCard(s.drcostfilter,tp,LOCATION_ONFIELD,0,2,nil) end
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
63+
local g=Duel.SelectMatchingCard(tp,s.drcostfilter,tp,LOCATION_ONFIELD,0,2,2,nil)
64+
Duel.SendtoGrave(g,REASON_COST)
6865
end
6966
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
7067
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
@@ -75,4 +72,4 @@ end
7572
function s.drop(e,tp,eg,ep,ev,re,r,rp)
7673
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
7774
Duel.Draw(p,d,REASON_EFFECT)
78-
end
75+
end

0 commit comments

Comments
 (0)