Commit e87c5f8c authored by wind2009's avatar wind2009

Fix ドローパン

parent dd83a22c
No preview for this file type
-- --ドローパン
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW) e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetCost(s.cost) e1:SetCost(s.cost)
...@@ -14,7 +16,7 @@ function s.initial_effect(c) ...@@ -14,7 +16,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsType,LOCATION_GRAVE,0,1,nil,TYPE_MONSTER) return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_MONSTER)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,200) end if chk==0 then return Duel.CheckLPCost(tp,200) end
...@@ -29,15 +31,20 @@ end ...@@ -29,15 +31,20 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then if Duel.Draw(p,d,REASON_EFFECT)~=0 then
local c=e:GetHandler()
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.ConfirmCards(1-p,tc) Duel.ConfirmCards(1-p,tc)
if not tc:IsType(TYPE_MONSTER) then end if not tc:IsType(TYPE_MONSTER) then
Duel.ShuffleHand(p)
return
end
Duel.BreakEffect() Duel.BreakEffect()
if Duel.IsExistingMatchingCard(Card.IsAttribute,p,LOCATION_GRAVE,0,1,nil,tc:GetAttribute()) then if Duel.IsExistingMatchingCard(Card.IsAttribute,p,LOCATION_GRAVE,0,1,nil,tc:GetAttribute()) then
local sg=Duel.GetMatchingGroup(Card.IsDiscardable,p,LOCATION_HAND,0,nil,REASON_EFFECT+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local dg=sg:Select(p,1,1,nil)
Duel.ShuffleHand(p) Duel.ShuffleHand(p)
Duel.DiscardHand(p,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
else else
Duel.Draw(p,1,REASON_EFFECT) Duel.Draw(p,1,REASON_EFFECT)
end end
......
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