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

2023/6/17 返回卡组操作修改

parent 82c9e353
Pipeline #22282 passed with stages
in 6 minutes and 37 seconds
......@@ -67,17 +67,21 @@ function RushDuel.IsPreviousRace(card, race)
return (card:GetPreviousRaceOnField() & race) ~= 0
end
-- 条件:可以攻击
function RushDuel.IsCanAttack(card)
return not card:IsHasEffect(EFFECT_CANNOT_ATTACK)
end
-- 条件: 可否赋予效果 - 直接攻击
function RushDuel.IsCanAttachDirectAttack(card)
return not card:IsHasEffect(EFFECT_DIRECT_ATTACK) and not card:IsHasEffect(EFFECT_CANNOT_ATTACK) and not card:IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK)
return RushDuel.IsCanAttack(card) and not card:IsHasEffect(EFFECT_DIRECT_ATTACK) and not card:IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK)
end
-- 条件: 可否赋予效果 - 贯通
function RushDuel.IsCanAttachPierce(card)
return not card:IsHasEffect(EFFECT_PIERCE) and not card:IsHasEffect(EFFECT_CANNOT_ATTACK)
return RushDuel.IsCanAttack(card) and not card:IsHasEffect(EFFECT_PIERCE)
end
-- 条件: 可否赋予效果 - 多次攻击
function RushDuel.IsCanAttachExtraAttack(card, value)
if card:IsHasEffect(EFFECT_CANNOT_ATTACK) then
if not RushDuel.IsCanAttack(card) then
return false
end
local values = RushDuel.GetEffectValues(card, EFFECT_EXTRA_ATTACK)
......@@ -90,7 +94,7 @@ function RushDuel.IsCanAttachExtraAttack(card, value)
end
-- 条件: 可否赋予效果 - 多次攻击 (怪兽限定)
function RushDuel.IsCanAttachExtraAttackMonster(card, value)
if card:IsHasEffect(EFFECT_CANNOT_ATTACK) then
if not RushDuel.IsCanAttack(card) then
return false
end
local values = RushDuel.GetEffectValues(card, EFFECT_EXTRA_ATTACK_MONSTER)
......@@ -103,7 +107,7 @@ function RushDuel.IsCanAttachExtraAttackMonster(card, value)
end
-- 条件: 可否赋予效果 - 全体攻击
function RushDuel.IsCanAttachAttackAll(card, value)
return not card:IsHasEffect(EFFECT_CANNOT_ATTACK)
return RushDuel.IsCanAttack(card)
end
-- 条件: 可否赋予效果 - 双重解放
function RushDuel.IsCanAttachDoubleTribute(card, value)
......
......@@ -104,6 +104,11 @@ function RushDuel.CostSendMatchToDeckTopOrBottom(filter, field, min, max, except
local action = RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_match(HINTMSG_TODECK, filter, field, 0, min, max, except_self, action)
end
-- 代价: 选择子卡片组, 返回卡组上面或下面
function RushDuel.CostSendGroupToDeckTopOrBottom(filter, check, field, min, max, except_self, top_desc, bottom_desc, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_group(HINTMSG_TODECK, filter, check, field, 0, min, max, except_self, action)
end
-- 代价: 选择匹配卡片, 返回手卡
function RushDuel.CostSendMatchToHand(filter, field, min, max, except_self, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_hand(REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
......@@ -197,6 +202,14 @@ end
function RushDuel.CostSendMZoneToDeckBottom(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_MZONE, min, max, except_self, SEQ_DECKBOTTOM, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让怪兽返回卡组上面或下面
function RushDuel.CostSendMZoneToDeckTopOrBottom(filter, min, max, top_desc, bottom_desc, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckTopOrBottom(filter, LOCATION_MZONE, min, max, except_self, top_desc, bottom_desc, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让场上的卡返回卡组
function RushDuel.CostSendOnFieldToDeck(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_ONFIELD, min, max, except_self, SEQ_DECKSHUFFLE, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让场上的卡返回卡组下面
function RushDuel.CostSendOnFieldToDeckBottom(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_ONFIELD, min, max, except_self, SEQ_DECKBOTTOM, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
......@@ -241,6 +254,10 @@ end
function RushDuel.CostSendGraveToDeckTopOrBottom(filter, min, max, top_desc, bottom_desc, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckTopOrBottom(filter, LOCATION_GRAVE, min, max, false, top_desc, bottom_desc, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组上面或下面 (子卡片组)
function RushDuel.CostSendGraveSubToDeckTopOrBottom(filter, check, min, max, top_desc, bottom_desc, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckTopOrBottom(filter, check, LOCATION_GRAVE, min, max, false, top_desc, bottom_desc, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把怪兽返回手卡
function RushDuel.CostSendMZoneToHand(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToHand(filter, LOCATION_MZONE, min, max, except_self, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
......
......@@ -121,18 +121,20 @@ end
-- 返回卡组并排序
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player)
local g = RushDuel.ToMaximunGroup(target)
if sequence == 1 and g:GetCount() > 1 then
if g:GetCount() > 1 and sequence == SEQ_DECKBOTTOM then
Duel.SendtoDeck(g, nil, SEQ_DECKTOP, reason)
else
Duel.SendtoDeck(g, nil, sequence, reason)
end
local og = Duel.GetOperatedGroup()
local ct = og:FilterCount(Card.IsLocation, nil, LOCATION_DECK)
if sequence ~= 2 and ct > 1 then
if sequence == SEQ_DECKTOP and ct > 1 then
Duel.SortDecktop(sort_player, target_player, ct)
if sequence == 1 then
RushDuel.SendDeckTopToBottom(target_player, ct)
elseif sequence == SEQ_DECKBOTTOM then
if ct > 1 then
Duel.SortDecktop(sort_player, target_player, ct)
end
RushDuel.SendDeckTopToBottom(target_player, ct)
end
return og, ct
end
......
......@@ -33,7 +33,7 @@ function RushDuel.InitLegend()
e1:SetValue(code)
c:RegisterEffect(e1, true)
-- 修改卡牌数据 (删除同名卡:传说卡)
c:SetCardData(2, code)
c:SetEntityCode(code, true)
end)
end
......
......@@ -18,7 +18,7 @@ function cm.costfilter(c)
return c:IsAttack(0) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and RD.IsCanAttack(c)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
......
......@@ -16,13 +16,9 @@ function cm.initial_effect(c)
end
--Damage
function cm.costfilter(c)
return c:IsFaceup() and c:IsAbleToDeckAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_FZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_FZONE,0,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
return c:IsFaceup() and c:IsLocation(LOCATION_FZONE) and c:IsAbleToDeckAsCost()
end
cm.cost=RD.CostSendOnFieldToDeck(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
RD.TargetDamage(1-tp,600)
......
......@@ -19,24 +19,11 @@ end
function cm.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
end
function cm.costcheck(g,tp)
return g:GetClassCount(Card.GetRace,nil)==g:GetCount()
function cm.costcheck(g,e,tp)
return g:GetClassCount(Card.GetRace)==g:GetCount()
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,g)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,3,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_COST)
local option=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
if option==1 then
RD.SendDeckTopToBottom(tp,ct)
end
end
cm.cost=RD.CostSendGraveSubToDeckTopOrBottom(cm.costfilter,cm.costcheck,3,3,aux.Stringid(m,1),aux.Stringid(m,2))
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
......
......@@ -31,7 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0
if tc and tc:IsRelateToBattle() and RD.SendToDeckAndExists(tc)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.Damage(1-tp,600,REASON_EFFECT)
end
......
......@@ -24,14 +24,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
Duel.SendtoDeck(g,nil,op,REASON_COST)
end
cm.cost=RD.CostSendMZoneToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2))
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
......
......@@ -29,14 +29,9 @@ end
function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,5,nil)
local ct=Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST)
e:SetValue(ct)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,5,nil,nil,function(g)
return m,g:GetCount()
end)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
if RD.IsMaximumMode(e:GetHandler()) then
......@@ -45,7 +40,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local down=e:GetValue()*-300
local _,ct=e:GetLabel()
local down=ct*-300
RD.AttachAtkDef(e,g:GetFirst(),down,down,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if RD.IsMaximumMode(e:GetHandler()) and not Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
......
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