This repository was archived by the owner on Oct 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathc511000514.lua
More file actions
71 lines (71 loc) · 2.28 KB
/
Copy pathc511000514.lua
File metadata and controls
71 lines (71 loc) · 2.28 KB
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
--Number 84: Pain Gainer
Duel.LoadCardScript("c26556950.lua")
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,11,2,s.ovfilter,aux.Stringid(id,0),3,s.xyzop)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
--gain atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetCountLimit(1)
e2:SetCondition(s.atkcon)
e2:SetCost(s.atkcost)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--battle indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(s.indes)
c:RegisterEffect(e3)
end
s.xyz_number=84
function s.cfilter(c)
return c:IsSetCard(0x95) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function s.ovfilter(c,tp,lc)
return c:IsFaceup() and c:IsRace(RACE_INSECT,lc,SUMMON_TYPE_XYZ,tp) and c:IsSetCard(0x48,lc,SUMMON_TYPE_XYZ,tp) and not c:IsSummonCode(lc,SUMMON_TYPE_XYZ,tp,id)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp~=tp then
Duel.Damage(1-tp,300,REASON_EFFECT)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(ev)
c:RegisterEffect(e1)
end
end
function s.indes(e,c)
return not c:IsSetCard(0x48)
end