Skip to content

Commit aea8b8e

Browse files
committed
update cards that use Cost.Choice
1 parent 5bbc415 commit aea8b8e

7 files changed

Lines changed: 26 additions & 27 deletions

File tree

official/c40390147.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ function s.spcheck(loc)
3232
end
3333
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
3434
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
35-
local loc=e:GetLabel()==1 and LOCATION_HAND or LOCATION_DECK
35+
local loc=e:GetChainData().cost_choice==1 and LOCATION_HAND or LOCATION_DECK
3636
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
3737
end
3838
function s.spop(e,tp,eg,ep,ev,re,r,rp)
3939
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
40-
local loc=e:GetLabel()==1 and LOCATION_HAND or LOCATION_DECK
40+
local loc=e:GetChainData().cost_choice==1 and LOCATION_HAND or LOCATION_DECK
4141
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
4242
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,loc,0,1,1,nil,e,tp)
4343
if #g>0 then

official/c45935145.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ s.effdetachcost=Cost.Choice(
6161
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6262
if chkc then return false end
6363
if chk==0 then return true end
64-
local op=e:GetLabel()
64+
local cd=e:GetChainData()
6565
local tc=Duel.GetFirstTarget()
66-
if op==1 then
66+
if cd.cost_choice==1 then
6767
e:SetCategory(CATEGORY_TODECK)
6868
Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,tp,0)
69-
elseif op==2 then
69+
elseif cd.cost_choice==2 then
7070
local categ=CATEGORY_SET|CATEGORY_LEAVE_GRAVE
7171
if tc:IsMonster() then
7272
e:SetCategory(CATEGORY_SPECIAL_SUMMON|categ)
@@ -79,11 +79,11 @@ end
7979
function s.effop(e,tp,eg,ep,ev,re,r,rp)
8080
local tc=Duel.GetFirstTarget()
8181
if not tc:IsRelateToEffect(e) then return end
82-
local op=e:GetLabel()
83-
if op==1 then
82+
local cd=e:GetChainData()
83+
if cd.cost_choice==1 then
8484
--Return it to the Deck
8585
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
86-
elseif op==2 then
86+
elseif cd.cost_choice==2 then
8787
--If the target is a monster, Special Summon it face-up, or in face-down Defense Position, to your field
8888
if tc:IsMonster() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
8989
and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP|POS_FACEDOWN_DEFENSE)>0

official/c78114463.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function s.initial_effect(c)
1717
e1:SetDescription(aux.Stringid(id,1))
1818
e1:SetType(EFFECT_TYPE_ACTIVATE)
1919
e1:SetCode(EVENT_CHAINING)
20-
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) end)
20+
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Chain.IsNegatable(ev) end)
2121
e1:SetCost(Cost.AND(s.revealcost,s.paylpcost))
2222
e1:SetTarget(s.target)
2323
e1:SetOperation(s.activate)
@@ -35,7 +35,7 @@ function s.revealcost(e,tp,eg,ep,ev,re,r,rp,chk)
3535
end
3636
end
3737
function s.banish_activation_chk(e,tp)
38-
local re=Duel.GetChainInfo(Duel.GetCurrentChain(),CHAININFO_TRIGGERING_EFFECT)
38+
local re=Chain.GetTriggeringEffect()
3939
local rc=re:GetHandler()
4040
return rc:IsAbleToRemove(tp) or (not rc:IsRelateToEffect(re) and Duel.IsPlayerCanRemove(tp))
4141
end
@@ -45,16 +45,16 @@ s.paylpcost=Cost.Choice(
4545
)
4646
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
4747
if chk==0 then return true end
48-
local op=e:GetLabel()
4948
local rc=re:GetHandler()
5049
local relation=rc:IsRelateToEffect(re)
50+
local cd=e:GetChainData()
5151
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0)
52-
if op==1 then
52+
if cd.cost_choice==1 then
5353
e:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
5454
if rc:IsDestructable() and relation then
5555
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
5656
end
57-
elseif op==2 then
57+
elseif cd.cost_choice==2 then
5858
e:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
5959
if relation then
6060
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,tp,0)
@@ -67,10 +67,10 @@ function s.banfilter(c,code,opp)
6767
return c:IsOriginalCodeRule(code) and c:IsAbleToRemove(opp)
6868
end
6969
function s.activate(e,tp,eg,ep,ev,re,r,rp)
70-
local op=e:GetLabel()
7170
local rc=re:GetHandler()
7271
local code=rc:GetOriginalCodeRule()
73-
if op==1 then
72+
local cd=e:GetChainData()
73+
if cd.cost_choice==1 then
7474
--● Pay 1500 LP; negate the activation, and if you do, destroy that card, and if you do that, for the rest of this turn, neither player can activate cards, or the effects of cards, with its same original name
7575
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
7676
--For the rest of this turn, neither player can activate cards, or the effects of cards, with its same original name
@@ -84,7 +84,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
8484
e1:SetReset(RESET_PHASE|PHASE_END)
8585
Duel.RegisterEffect(e1,tp)
8686
end
87-
elseif op==2 then
87+
elseif cd.cost_choice==2 then
8888
--● Pay 3000 LP; negate the activation, and if you do, banish that card, then your opponent banishes all cards with its same original name from their hand and Deck
8989
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)>0 then
9090
local opp=1-tp
@@ -95,4 +95,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
9595
end
9696
end
9797
end
98-
end
98+
end

official/c84417082.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ function s.desallcheck(e,tp,eg,ep,ev,re,r,rp,chk)
2929
end
3030
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
3131
if chk==0 then return true end
32-
local g=e:GetLabel()==1
32+
local g=e:GetChainData().cost_choice==1
3333
and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
3434
or Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
3535
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
3636
end
3737
function s.desop(e,tp,eg,ep,ev,re,r,rp)
3838
local c=e:GetHandler()
3939
local exc=c:IsRelateToEffect(e) and c or nil
40-
local g=e:GetLabel()==1
40+
local g=e:GetChainData().cost_choice==1
4141
and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,exc)
4242
or Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
4343
if #g>0 then

official/c85692042.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
7575
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
7676
end
7777
function s.thop(e,tp,eg,ep,ev,re,r,rp)
78-
local op=e:GetLabel()
79-
local filter=(op==1 and s.mmfilter)
80-
or (op==2 and s.l4filter)
78+
local cd=e:GetChainData()
79+
local filter=(cd.cost_choice==1 and s.mmfilter)
80+
or (cd.cost_choice==2 and s.l4filter)
8181
or s.stfilter
8282
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
8383
local g=Duel.SelectMatchingCard(tp,filter,tp,LOCATION_DECK,0,1,1,nil)

pre-release/c100455026.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function s.initial_effect(c)
1818
--● Add 1 "Witchcrafter" Spell from your Deck to your hand
1919
{aux.TRUE,aux.Stringid(id,2),function(e,tp) return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end},
2020
--● Reveal 1 "Witchcrafter" Normal or Quick-Play Spell in your hand; apply that Spell's activation effect
21-
{Cost.Reveal(s.revealfilter,nil,1,1,function(e,tp,og) e:SetLabelObject(og) end),aux.Stringid(id,3),nil}
21+
{Cost.Reveal(s.revealfilter,nil,1,1,function(e,tp,og) e:GetChainData().revealed_card=og:GetFirst() end),aux.Stringid(id,3),nil}
2222
)
2323
)
2424
e1:SetTarget(s.efftg)
@@ -58,8 +58,7 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
5858
elseif cd.cost_choice==2 then
5959
--● Reveal 1 "Witchcrafter" Normal or Quick-Play Spell in your hand; apply that Spell's activation effect
6060
e:SetCategory(0)
61-
local revealed_card=e:GetLabelObject():GetFirst()
62-
local te,ceg,cep,cev,cre,cr,crp=revealed_card:CheckActivateEffect(true,true,true)
61+
local te,ceg,cep,cev,cre,cr,crp=cd.revealed_card:CheckActivateEffect(true,true,true)
6362
Duel.ClearTargetCard()
6463
local tg=te:GetTarget()
6564
e:SetProperty(te:GetProperty())

unofficial/c511001339.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
3232
end
3333
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3434
if chk==0 then return true end
35-
if e:GetLabel()==1 then
35+
if e:GetChainData().cost_choice==1 then
3636
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x1101)
3737
end
3838
end
@@ -45,7 +45,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
4545
e1:SetValue(1)
4646
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
4747
c:RegisterEffect(e1)
48-
if e:GetLabel()==1 then
48+
if e:GetChainData().cost_choice==1 then
4949
local e2=Effect.CreateEffect(c)
5050
e2:SetType(EFFECT_TYPE_FIELD)
5151
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)

0 commit comments

Comments
 (0)