-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathc160012040.lua
71 lines (71 loc) · 2.31 KB
/
c160012040.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--蒼救の一閃 ディグレイス
--Digrace the Skysavior Radiance
--scripted by YoshiDuels
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Fusion Summon procedure
Fusion.AddProcMix(c,true,true,160012025,CARD_SKYSAVIOR_SOLEIL)
--ATK increase
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(s.cost)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--Extra attack on monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(function(e) return Duel.IsAbleToEnterBP() end)
e2:SetCost(s.cost)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CELESTIALWARRIOR)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.FilterMaximumSideFunctionEx(s.atkfilter),tp,LOCATION_MZONE,0,1,nil) end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
--Requirement
if Duel.DiscardDeck(tp,1,REASON_COST)<1 then return end
--Effect
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atkval=Duel.GetMatchingGroupCount(aux.FilterMaximumSideFunctionEx(s.atkfilter),tp,LOCATION_MZONE,0,nil)*1000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atkval)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_END)
c:RegisterEffect(e1)
end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
--Requirement
if Duel.DiscardDeck(tp,1,REASON_COST)<1 then return end
--Effect
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
--Attack up to twice
local e1=Effect.CreateEffect(c)
e1:SetDescription(3201)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(1)
e1:SetReset(RESETS_STANDARD_PHASE_END)
c:RegisterEffect(e1)
end
end