Skip to content

Commit ffaac12

Browse files
committed
added Rebel's Dive
1 parent e54282e commit ffaac12

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

rush/c160026062.lua

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
--絶超デモンスダイブ
2+
--Rebel's Dive
3+
--scripted by YoshiDuels
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
-- Destroy
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_DESTROY)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_SUMMON_SUCCESS)
12+
e1:SetCost(s.cost)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.operation)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.cfilter(c)
18+
return c:IsMonster() and c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeckOrExtraAsCost()
19+
end
20+
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
21+
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
22+
end
23+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
24+
local tc=eg:GetFirst()
25+
if chk==0 then return ep==1-tp and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsLevelBelow(4) end
26+
tc:CreateEffectRelation(e)
27+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
28+
end
29+
function s.spfilter(c,e,tp)
30+
return c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevelAbove(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
31+
end
32+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
33+
--Requirement
34+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
35+
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,2,2,nil)
36+
Duel.HintSelection(g)
37+
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)<1 then return end
38+
--Effect
39+
local tc=eg:GetFirst()
40+
local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
41+
if tc and Duel.Destroy(tc,REASON_EFFECT)>0 and #sg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
43+
local ssg=sg:Select(tp,1,1,nil)
44+
if #ssg>0 then
45+
Duel.SpecialSummon(ssg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
46+
end
47+
end
48+
end

0 commit comments

Comments
 (0)