-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathc100000011.lua
29 lines (29 loc) · 1.07 KB
/
c100000011.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
--時械天使
function c100000011.initial_effect(c)
--to HAND
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c100000011.condition)
e1:SetTarget(c100000011.thtg)
e1:SetOperation(c100000011.operation)
c:RegisterEffect(e1)
end
function c100000011.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
and c:GetBattlePosition()==POS_FACEUP_ATTACK
end
function c100000011.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100000011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c100000011.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c100000011.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c100000011.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SendtoHand(sg,nil,sg:GetCount(),REASON_EFFECT)
end