Skip to content

Commit e572018

Browse files
committed
update Cost.Choice and Cost.DetachFromSelf
* `Cost.Choice` now stores the selected choice as chain data, instead of a label * `Cost.DetachFromSelf` now stores the detached material as chain data
1 parent b9fd80a commit e572018

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

utility.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,12 @@ function Cost.DetachFromSelf(min,max,op)
15831583
local min_count=min_type=="function" and min(e,tp) or min
15841584
local max_count=max_type=="function" and max(e,tp) or max
15851585
if chk==0 then return min_count>0 and max_count>=min_count and c:CheckRemoveOverlayCard(tp,min_count,REASON_COST) end
1586-
if c:RemoveOverlayCard(tp,min_count,max_count,REASON_COST)>0 and op then
1587-
op(e,Duel.GetOperatedGroup())
1586+
if c:RemoveOverlayCard(tp,min_count,max_count,REASON_COST)>0 then
1587+
local cd=Chain.Data()
1588+
cd.cost_detached_materials=Duel.GetOperatedGroup()
1589+
if op then
1590+
op(e,cd.cost_detached_materials)
1591+
end
15881592
end
15891593
end
15901594

@@ -1729,9 +1733,9 @@ function Cost.Choice(...)
17291733

17301734
if chk==0 then return has_choice end
17311735

1732-
local op=Duel.SelectEffect(tp,table.unpack(ops))
1733-
choices[op][1](e,tp,eg,ep,ev,re,r,rp,1)
1734-
e:SetLabel(op)
1736+
local cd=e:GetChainData()
1737+
cd.cost_choice=Duel.SelectEffect(tp,table.unpack(ops))
1738+
choices[cd.cost_choice][1](e,tp,eg,ep,ev,re,r,rp,1)
17351739
end
17361740

17371741
for _,t in pairs(cost_tables) do

0 commit comments

Comments
 (0)