Skip to content

Commit 4de4336

Browse files
committed
added Planet Survey
1 parent 60994c9 commit 4de4336

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

rush/c160025059.lua

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--惑星調査
2+
--Planet Survey
3+
--scripted by YoshiDuels
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
-- Add excavated monster to hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCondition(s.condition)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.operation)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.cfilter(c)
18+
return c:IsMonster() and c:IsRace(RACE_GALAXY)
19+
end
20+
function s.condition(e,tp,eg,ep,ev,re,r,rp)
21+
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil)
22+
end
23+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
24+
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end
25+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
26+
end
27+
function s.filter(c)
28+
return ((c:IsSpell() and c:IsType(TYPE_FIELD)) or (c:IsMonster() and c:IsRace(RACE_GALAXY) and c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK))) and c:IsAbleToHand()
29+
end
30+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
31+
--Effect
32+
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<4 then return end
33+
Duel.ConfirmDecktop(tp,4)
34+
local g=Duel.GetDecktopGroup(tp,4)
35+
Duel.DisableShuffleCheck()
36+
if g:IsExists(s.filter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
38+
local tg=g:FilterSelect(tp,s.filter,1,1,nil)
39+
if #tg>0 then
40+
Duel.SendtoHand(tg,nil,REASON_EFFECT)
41+
Duel.ConfirmCards(1-tp,tg)
42+
Duel.ShuffleHand(tp)
43+
g:RemoveCard(tg)
44+
end
45+
end
46+
local ct=#g
47+
if ct>0 then
48+
Duel.MoveToDeckBottom(ct,tp)
49+
Duel.SortDeckbottom(tp,tp,ct)
50+
end
51+
end

0 commit comments

Comments
 (0)