Commit 1239e915 authored by 未闻皂名's avatar 未闻皂名

2023/8/2 新增:绅士机会

parent 8d16bb2e
Pipeline #22866 passed with stages
in 6 minutes and 6 seconds
No preview for this file type
...@@ -21,8 +21,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,8 +21,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
RD.TargetDiscardDeck(tp,3) RD.TargetDiscardDeck(tp,3)
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.DiscardDeck() if RD.DiscardDeck()~=0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
RD.SendToHandAndExists(g,1-tp) RD.SendToHandAndExists(g,1-tp)
end) end)
......
local m=120249055
local cm=_G["c"..m]
cm.name="绅士机会"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.exfilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
RD.TargetDiscardDeck(tp,3)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.DiscardDeck()~=0 and not Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,4,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
RD.SendToHandAndExists(g,1-tp)
end)
end
end
\ No newline at end of file
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