|
| 1 | +--サイバーポッド |
| 2 | +--Cyber Jar (GOAT) |
| 3 | +--Scripted by edo9300 |
| 4 | +--Unlike OCG, first both players reveal, then both summon |
| 5 | +local s,id=GetID() |
| 6 | +function s.initial_effect(c) |
| 7 | + --flip |
| 8 | + local e1=Effect.CreateEffect(c) |
| 9 | + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH) |
| 10 | + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) |
| 11 | + e1:SetTarget(s.target) |
| 12 | + e1:SetOperation(s.operation) |
| 13 | + c:RegisterEffect(e1) |
| 14 | +end |
| 15 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 16 | + if chk==0 then return true end |
| 17 | + local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) |
| 18 | + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) |
| 19 | + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,PLAYER_ALL,LOCATION_DECK) |
| 20 | +end |
| 21 | +function s.spchk(c,e,tp) |
| 22 | + return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE) |
| 23 | +end |
| 24 | +local function summon(g,e,p,tograve,ft) |
| 25 | + if #g==0 then return end |
| 26 | + if ft==0 then |
| 27 | + tograve:Merge(g) |
| 28 | + return |
| 29 | + end |
| 30 | + if ft<#g then |
| 31 | + Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON) |
| 32 | + local newg=g:Select(p,ft,ft,nil) |
| 33 | + tograve:Merge(g:Sub(newg)) |
| 34 | + g=newg |
| 35 | + end |
| 36 | + for tc in g:Iter() do |
| 37 | + Duel.SpecialSummonStep(tc,0,p,p,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE) |
| 38 | + end |
| 39 | +end |
| 40 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 41 | + local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) |
| 42 | + Duel.Destroy(g,REASON_EFFECT) |
| 43 | + Duel.BreakEffect() |
| 44 | + local p=Duel.GetTurnPlayer() |
| 45 | + local summonable1,nonsummonable1=Duel.GetDecktopGroup(p,5):Split(s.spchk,nil,e,p) |
| 46 | + local summonable2,nonsummonable2=Duel.GetDecktopGroup(1-p,5):Split(s.spchk,nil,e,1-p) |
| 47 | + local ft1=Duel.GetLocationCount(p,LOCATION_MZONE) |
| 48 | + if ft1>1 and Duel.IsPlayerAffectedByEffect(p,CARD_BLUEEYES_SPIRIT) and #summonable1>1 then |
| 49 | + nonsummonable1:Merge(summonable1) |
| 50 | + summonable1:Clear() |
| 51 | + end |
| 52 | + local ft2=Duel.GetLocationCount(1-p,LOCATION_MZONE) |
| 53 | + if ft2>1 and Duel.IsPlayerAffectedByEffect(1-p,CARD_BLUEEYES_SPIRIT) and #summonable2>1 then |
| 54 | + nonsummonable2:Merge(summonable2) |
| 55 | + summonable2:Clear() |
| 56 | + end |
| 57 | + local tohand,tograve=nonsummonable1:Merge(nonsummonable2):Split(Card.IsAbleToHand,nil) |
| 58 | + Duel.DisableShuffleCheck() |
| 59 | + Duel.ConfirmDecktop(p,5) |
| 60 | + Duel.ConfirmDecktop(1-p,5) |
| 61 | + summon(summonable1,e,p,tograve,ft1) |
| 62 | + summon(summonable2,e,1-p,tograve,ft2) |
| 63 | + Duel.SpecialSummonComplete() |
| 64 | + if #tohand>0 then |
| 65 | + Duel.SendtoHand(tohand,nil,REASON_EFFECT) |
| 66 | + Duel.ShuffleHand(tp) |
| 67 | + Duel.ShuffleHand(1-tp) |
| 68 | + end |
| 69 | + if #tograve>0 then |
| 70 | + Duel.SendtoGrave(tograve,REASON_EFFECT) |
| 71 | + end |
| 72 | + local fg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil) |
| 73 | + Duel.ShuffleSetCard(fg) |
| 74 | +end |
0 commit comments