Skip to content

Commit

Permalink
added Ancient Gear Barrage
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshi80 committed Sep 18, 2024
1 parent a428f83 commit 2ae0eeb
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions rush/c160212015.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--古代の機械砲撃
--Ancient Gear Barrage
--Scripted by YoshiDuels
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function s.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToDeckOrExtraAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,4,nil) end
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsNotMaximumModeSide,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
--Requirement
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,4,4,nil)
if #g==0 then return end
Duel.HintSelection(g)
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)==0 then return end
--Effect
local g=Duel.GetMatchingGroup(Card.IsNotMaximumModeSide,tp,0,LOCATION_ONFIELD,nil)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
if #dg>0 then
Duel.HintSelection(dg)
dg=dg:AddMaximumCheck()
Duel.Destroy(dg,REASON_EFFECT)
end
end

0 comments on commit 2ae0eeb

Please sign in to comment.