-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc72405967.lua
More file actions
32 lines (32 loc) · 1.17 KB
/
c72405967.lua
File metadata and controls
32 lines (32 loc) · 1.17 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
--王家の生け贄
function c72405967.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c72405967.condition)
e1:SetTarget(c72405967.target)
e1:SetOperation(c72405967.activate)
c:RegisterEffect(e1)
end
function c72405967.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(47355498,tp)
end
function c72405967.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,LOCATION_HAND,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_HAND)
end
function c72405967.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g2)
Duel.ConfirmCards(1-tp,g1)
local dg1=g1:Filter(Card.IsType,nil,TYPE_MONSTER)
local dg2=g2:Filter(Card.IsType,nil,TYPE_MONSTER)
dg1:Merge(dg2)
if dg1:GetCount()>0 then Duel.SendtoGrave(dg1,REASON_EFFECT+REASON_DISCARD) end
Duel.ShuffleHand(tp)
Duel.ShuffleHand(1-tp)
end