|
| 1 | +--ヴァリアブル・ステライザー |
| 2 | +--Variable Stellarizer |
| 3 | +--Scripted by YoshiDuels |
| 4 | +local s,id=GetID() |
| 5 | +function s.initial_effect(c) |
| 6 | + --Change name |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetDescription(aux.Stringid(id,0)) |
| 9 | + e1:SetType(EFFECT_TYPE_IGNITION) |
| 10 | + e1:SetRange(LOCATION_MZONE) |
| 11 | + e1:SetCountLimit(1) |
| 12 | + e1:SetCost(s.cost) |
| 13 | + e1:SetOperation(s.operation) |
| 14 | + c:RegisterEffect(e1) |
| 15 | +end |
| 16 | +function s.revealfilter(c) |
| 17 | + return c:IsType(TYPE_FUSION) and c:IsRace(RACE_GALAXY) and c:IsLevel(9) and c.material and not c:IsPublic() |
| 18 | +end |
| 19 | +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) |
| 20 | + if chk==0 then return Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_EXTRA,0,1,nil) end |
| 21 | +end |
| 22 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 23 | + local c=e:GetHandler() |
| 24 | + --Requirement |
| 25 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) |
| 26 | + local tc=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst() |
| 27 | + Duel.ConfirmCards(1-tp,tc) |
| 28 | + Duel.ShuffleExtra(tp) |
| 29 | + --Effect |
| 30 | + local announceFilter={} |
| 31 | + for _,name in pairs(tc.material) do |
| 32 | + if #announceFilter==0 then |
| 33 | + table.insert(announceFilter,name) |
| 34 | + table.insert(announceFilter,OPCODE_ISCODE) |
| 35 | + else |
| 36 | + table.insert(announceFilter,name) |
| 37 | + table.insert(announceFilter,OPCODE_ISCODE) |
| 38 | + table.insert(announceFilter,OPCODE_OR) |
| 39 | + end |
| 40 | + end |
| 41 | + local code=Duel.AnnounceCard(tp,announceFilter) |
| 42 | + local e1=Effect.CreateEffect(c) |
| 43 | + e1:SetType(EFFECT_TYPE_SINGLE) |
| 44 | + e1:SetCode(EFFECT_ADD_CODE) |
| 45 | + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) |
| 46 | + e1:SetReset(RESETS_STANDARD_PHASE_END) |
| 47 | + e1:SetValue(code) |
| 48 | + e1:SetOperation(s.chngcon) |
| 49 | + c:RegisterEffect(e1) |
| 50 | +end |
| 51 | +function s.chngcon(scard,sumtype,tp) |
| 52 | + return Fusion.SummonEffect and Fusion.SummonEffect:GetHandler():IsCode(CARD_FUSION) and ((sumtype&MATERIAL_FUSION)~=0 or (sumtype&SUMMON_TYPE_FUSION)~=0) |
| 53 | +end |
0 commit comments