--ミソスアリーナ local m=15747846 local cm=_G["c"..m] function cm.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --draw local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(m,0)) e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCountLimit(1) e4:SetRange(LOCATION_FZONE) e4:SetTarget(cm.target) e4:SetOperation(cm.operation) c:RegisterEffect(e4) --to hand local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_DESTROYED) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e5:SetCondition(cm.thcon) e5:SetTarget(cm.thtg) e5:SetOperation(cm.thop) c:RegisterEffect(e5) end cm.is_named_with_Mythos=1 function cm.IsMythos(c) local m=_G["c"..c:GetCode()] return m and m.is_named_with_Mythos end function cm.filter(c) return cm.IsMythos(c) and c:IsAbleToDeck() and not c:IsPublic() end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function cm.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(p,cm.filter,p,LOCATION_HAND,0,1,99,nil) if g:GetCount()>0 then Duel.ConfirmCards(1-p,g) local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.ShuffleDeck(p) Duel.BreakEffect() Duel.Draw(p,ct,REASON_EFFECT) Duel.ShuffleHand(p) end end function cm.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_FZONE) end function cm.thfilter(c) return cm.IsMythos(c) and c:IsAbleToHand() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end