Skip to content

Commit 80f4ba1

Browse files
committed
added Drache the Dragon Vassal
1 parent 9af4a79 commit 80f4ba1

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

‎rush/c160324004.lua‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--竜帝家臣ドラーヘ
2+
--Drache the Dragon Vassal
3+
--scripted by YoshiDuels
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Increase Level by 1
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,2))
9+
e1:SetType(EFFECT_TYPE_IGNITION)
10+
e1:SetRange(LOCATION_MZONE)
11+
e1:SetCountLimit(1)
12+
e1:SetCondition(s.condition)
13+
e1:SetCost(s.cost)
14+
e1:SetTarget(s.target)
15+
e1:SetOperation(s.operation)
16+
c:RegisterEffect(e1)
17+
--Register when a player Special Summons a monster
18+
aux.GlobalCheck(s,function()
19+
local ge1=Effect.CreateEffect(c)
20+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
21+
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
22+
ge1:SetOperation(s.checkop)
23+
Duel.RegisterEffect(ge1,0)
24+
end)
25+
end
26+
s.listed_names={160324002,160324003}
27+
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
28+
for tc in eg:Iter() do
29+
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),id,RESET_PHASE|PHASE_END,0,1)
30+
end
31+
end
32+
function s.condition(e,tp,eg,ep,ev,re,r,rp)
33+
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
34+
end
35+
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
36+
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
37+
end
38+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
39+
if chk==0 then return e:GetHandler():HasLevel() end
40+
end
41+
function s.thfilter(c)
42+
return c:IsCode(160324002,160324003) and c:IsAbleToHand()
43+
end
44+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
45+
local c=e:GetHandler()
46+
--Requirement
47+
if Duel.DiscardDeck(tp,1,REASON_COST)<1 then return end
48+
local ct=Duel.GetOperatedGroup():GetFirst()
49+
--Effect
50+
c:UpdateLevel(2,RESETS_STANDARD_PHASE_END,c)
51+
if not Duel.HasFlagEffect(tp,id) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
53+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
54+
if #g>0 then
55+
Duel.SendtoHand(g,nil,REASON_EFFECT)
56+
Duel.ConfirmCards(1-tp,g)
57+
end
58+
end
59+
end

0 commit comments

Comments
 (0)