Commit 2c7f3fbc authored by mercury233's avatar mercury233

update new card

parent 57ce4b7d
#created by ...
#main
100425006
100425038
101106201
101106202
......
--SRルーレット
--scripted by XyleN
function c100425006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100425006+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100425006.cost)
e1:SetTarget(c100425006.target)
e1:SetOperation(c100425006.activate)
c:RegisterEffect(e1)
end
c100425006.toss_dice=true
function c100425006.cfilter(c,e,tp)
return c:IsDiscardable()
and Duel.IsExistingMatchingCard(c100425006.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,6)
end
function c100425006.spfilter(c,e,tp,lv)
return c:IsSetCard(0x2016) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100425006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c100425006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=e:GetLabel()==100
e:SetLabel(0)
return res or Duel.IsExistingMatchingCard(c100425006.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,6)
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c100425006.fselect(g,lv)
return g:GetSum(Card.GetLevel)==lv
end
function c100425006.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=Duel.TossDice(tp,1)
local res=false
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>0 then
if ft>2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(c100425006.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp,dc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c100425006.fselect,false,1,ft,dc)
if sg then
for tc in aux.Next(sg) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
res=true
end
end
if not res then
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp-dc*500)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment