Commit b376b223 authored by 未闻皂名's avatar 未闻皂名

2026/1/13 bug修复

parent a122b69b
...@@ -541,16 +541,17 @@ function RushDuel.CanDraw(desc, player, count, break_effect) ...@@ -541,16 +541,17 @@ function RushDuel.CanDraw(desc, player, count, break_effect)
return 0 return 0
end end
-- 可选操作: 盲堆 -- 可选操作: 盲堆
function RushDuel.CanDiscardDeck(desc, player, min, max, break_effect) function RushDuel.CanDiscardDeck(desc, player, min, max, break_effect, target_player)
if Duel.IsPlayerCanDiscardDeck(player, min) and Duel.SelectYesNo(player, desc) then target_player = target_player or player
if Duel.IsPlayerCanDiscardDeck(target_player, min) and Duel.SelectYesNo(player, desc) then
if break_effect then if break_effect then
Duel.BreakEffect() Duel.BreakEffect()
end end
max = max or min max = max or min
local ct = Duel.GetFieldGroupCount(player, LOCATION_DECK, 0) local ct = Duel.GetFieldGroupCount(target_player, LOCATION_DECK, 0)
local ops = {} local ops = {}
for i = min, math.min(max, ct) do for i = min, math.min(max, ct) do
if Duel.IsPlayerCanDiscardDeck(player, i) then if Duel.IsPlayerCanDiscardDeck(target_player, i) then
table.insert(ops, i) table.insert(ops, i)
end end
end end
...@@ -561,7 +562,7 @@ function RushDuel.CanDiscardDeck(desc, player, min, max, break_effect) ...@@ -561,7 +562,7 @@ function RushDuel.CanDiscardDeck(desc, player, min, max, break_effect)
Duel.Hint(HINT_SELECTMSG, player, HINTMSG_OPERATE_COUNT) Duel.Hint(HINT_SELECTMSG, player, HINTMSG_OPERATE_COUNT)
count = Duel.AnnounceNumber(player, table.unpack(ops)) count = Duel.AnnounceNumber(player, table.unpack(ops))
end end
return Duel.DiscardDeck(player, count, REASON_EFFECT) return Duel.DiscardDeck(target_player, count, REASON_EFFECT)
end end
return 0 return 0
end end
......
...@@ -243,7 +243,7 @@ function RushDuel.GetRitualSummonData(e, tp, type, matfilter, spfilter, exfilter ...@@ -243,7 +243,7 @@ function RushDuel.GetRitualSummonData(e, tp, type, matfilter, spfilter, exfilter
end end
if #mg2 > 0 then if #mg2 > 0 then
local mf = effect:GetValue() local mf = effect:GetValue()
local sg2 = Duel.GetMatchingGroup(RushDuel.RitualSpecialSummonFilter, tp, LOCATION_EXTRA, 0, nil, e, tp, pos, mg2, mf, gc, chkf, spfilter) local sg2 = Duel.GetMatchingGroup(RushDuel.RitualSpecialSummonFilter, tp, LOCATION_EXTRA, 0, nil, e, tp, type, mg2, mf, gc, chkf, spfilter)
if #sg2 > 0 then if #sg2 > 0 then
table.insert(list, {effect, mg2, sg2}) table.insert(list, {effect, mg2, sg2})
ritualable = true ritualable = true
......
...@@ -17,5 +17,5 @@ function cm.spfilter(c,e,tp,mat) ...@@ -17,5 +17,5 @@ function cm.spfilter(c,e,tp,mat)
and not mat:IsExists(Card.IsCode,1,nil,c:GetCode()) and not mat:IsExists(Card.IsCode,1,nil,c:GetCode())
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,mat,rc) function cm.operation(e,tp,eg,ep,ev,re,r,rp,mat,rc)
RD.CanDiscardDeck(aux.Stringid(m,1),1-tp,1,mat:GetCount()) RD.CanDiscardDeck(aux.Stringid(m,1),tp,1,mat:GetCount(),1-tp)
end end
\ No newline at end of file
...@@ -10,16 +10,17 @@ function cm.initial_effect(c) ...@@ -10,16 +10,17 @@ function cm.initial_effect(c)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- Ritual Expend -- Ritual Expend
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_RITUAL_MATERIAL) e2:SetCode(EFFECT_RITUAL_MATERIAL)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e1:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e1:SetTarget(cm.target) e2:SetTarget(cm.target)
e1:SetOperation(cm.operation) e2:SetOperation(cm.operation)
c:RegisterEffect(e1) e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
end end
--Activate --Activate
function cm.confilter(c) function cm.confilter(c)
......
...@@ -27,7 +27,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,7 +27,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and eg:IsExists(cm.confilter,1,nil,1-tp) return Duel.GetTurnPlayer()==1-tp and eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment