-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathc160014045.lua
60 lines (60 loc) · 2.18 KB
/
c160014045.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
--ジョインテック・バーストドラゴン
--Jointech Burst Dragon
--scripted by YoshiDuels
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,160009019,CARD_BLUETOOTH_B_DRAGON)
--Destroy monsters with 1500 ATK or less
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
end
function s.desfilter(c)
return c:IsFaceup() and c:IsAttackBelow(2500) and c:IsNotMaximumModeSide()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,#g*500)
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_SZONE)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
--Requirement
if Duel.DiscardDeck(tp,1,REASON_COST)<1 then return end
--Effect
local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
g=g:AddMaximumCheck()
local c=e:GetHandler()
if Duel.Destroy(g,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local og=Duel.GetOperatedGroup()
local ct=og:GetCount()
if og:IsExists(Card.WasMaximumModeSide,1,nil) then ct=1 end
Duel.BreakEffect()
--Increase ATK
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_END)
e1:SetValue(ct*500)
c:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g,true)
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end