-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc41307269.lua
More file actions
44 lines (44 loc) · 1.55 KB
/
c41307269.lua
File metadata and controls
44 lines (44 loc) · 1.55 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
--Superheavy Samurai Kabuto
function c41307269.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41307269,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c41307269.condition)
e1:SetTarget(c41307269.target)
e1:SetOperation(c41307269.operation)
c:RegisterEffect(e1)
end
function c41307269.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
function c41307269.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c41307269.cfilter,1,nil,tp)
end
function c41307269.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x9a)
end
function c41307269.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41307269.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c41307269.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c41307269.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c41307269.filter,tp,LOCATION_MZONE,0,nil)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0)
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end