Commit 52b9c2a2 authored by mercury233's avatar mercury233

update scripts

parent 28ad8efd
--一撃必殺!居合いドロー
--Slash Draw
--Script by dest
function c100227020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DRAW+CATEGORY_DESTROY+CATEGORY_DAMAGE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100227020+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100227020.cost)
e1:SetTarget(c100227020.target)
e1:SetOperation(c100227020.activate)
c:RegisterEffect(e1)
end
function c100227020.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100227020.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>ct and Duel.IsPlayerCanDiscardDeck(tp,ct)
and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100227020.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ct>0 and Duel.DiscardDeck(tp,ct,REASON_EFFECT)~=0 then
Duel.BreakEffect()
local ct2=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetCount()
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:IsCode(100227020) then
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if #tg>0 then
Duel.BreakEffect()
local dam=#tg*2000
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,ct2,ct2,nil)
if #dg>0 then
Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)
end
end
end
end
end
...@@ -80,7 +80,8 @@ end ...@@ -80,7 +80,8 @@ end
function c100228004.spcon(e,c) function c100228004.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return ((c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or
(c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0))
and Duel.IsExistingMatchingCard(c100228004.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT) and Duel.IsExistingMatchingCard(c100228004.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_LIGHT)
and Duel.IsExistingMatchingCard(c100228004.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK) and Duel.IsExistingMatchingCard(c100228004.spfilter,tp,LOCATION_GRAVE,0,1,nil,ATTRIBUTE_DARK)
end end
...@@ -116,9 +117,12 @@ function c100228004.gyop(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,9 +117,12 @@ function c100228004.gyop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 then return end if g:GetCount()==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 then return end
local oc=Duel.GetOperatedGroup():FilterCount(c100228004.sgfilter,nil,tp) local oc=Duel.GetOperatedGroup():FilterCount(c100228004.sgfilter,nil,tp)
if oc==0 then return end if oc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local og=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,oc,nil) local og=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,oc,nil)
if Duel.SendtoGrave(og,REASON_EFFECT)>0 then if Duel.SendtoGrave(og,REASON_EFFECT)>0 then
local dc=Duel.GetOperatedGroup():FilterCount(c100228004.sgfilter,nil,1-tp) local dc=Duel.GetOperatedGroup():FilterCount(c100228004.sgfilter,nil,1-tp)
if dc==0 then return end
Duel.BreakEffect()
Duel.Damage(1-tp,dc*300,REASON_EFFECT) Duel.Damage(1-tp,dc*300,REASON_EFFECT)
end end
end end
......
...@@ -33,7 +33,7 @@ function c101004084.mfilterf(c,tp,mg,dg,rc) ...@@ -33,7 +33,7 @@ function c101004084.mfilterf(c,tp,mg,dg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c) Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc) return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
or dg:IsExists(c101004084.dlvfilter,1,nil,tp,mg,rc,rc:GetLevel()-c:GetRitualLevel()) or dg:IsExists(c101004084.dlvfilter,1,nil,tp,mg,rc,rc:GetLevel()-c:GetRitualLevel(rc))
else return false end else return false end
end end
function c101004084.dlvfilter(c,tp,mg,rc,lv) function c101004084.dlvfilter(c,tp,mg,rc,lv)
......
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