forked from Fluorohydride/ygopro-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc10875327.lua
More file actions
66 lines (66 loc) · 2.14 KB
/
c10875327.lua
File metadata and controls
66 lines (66 loc) · 2.14 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
--地縛神 Aslla piscu
function c10875327.initial_effect(c)
c:SetUniqueOnField(1,1,10000000)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetCondition(c10875327.sdcon)
c:RegisterEffect(e4)
--battle target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(aux.imval1)
c:RegisterEffect(e5)
--direct atk
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e6)
--destroy
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(10875327,0))
e7:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetCondition(c10875327.descon)
e7:SetTarget(c10875327.destg)
e7:SetOperation(c10875327.desop)
c:RegisterEffect(e7)
end
function c10875327.sdcon(e)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return ((f1==nil or not f1:IsFaceup()) and (f2==nil or not f2:IsFaceup()))
end
function c10875327.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
and (not re or re:GetHandler()~=c)
end
function c10875327.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c10875327.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c10875327.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
if g:GetCount()~=0 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetCount()*800)
end
end
function c10875327.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c10875327.desfilter,tp,0,LOCATION_MZONE,nil)
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct~=0 then
Duel.BreakEffect()
Duel.Damage(1-tp,ct*800,REASON_EFFECT)
end
end