--Geneseed Cherryxie local cid,id=GetID() function cid.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(16956455,0)) e2:SetCategory(CATEGORY_TODECK) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,id) e2:SetRange(LOCATION_MZONE) e2:SetCost(cid.descost) e2:SetTarget(cid.destg) e2:SetOperation(cid.desop) c:RegisterEffect(e2) end function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and bit.band(r,REASON_DISCARD)~=0 end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end function cid.cfilter(c) return c:IsDiscardable() end function cid.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,cid.cfilter,1,1,REASON_COST+REASON_DISCARD) end function cid.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) end function cid.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND+LOCATION_GRAVE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_HAND+LOCATION_GRAVE) end function cid.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil) local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil) local sg=Group.CreateGroup() if g1:GetCount()>0 and ((sg:GetCount()==0 and g2:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(id,2))) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg1=g1:Select(tp,1,1,nil) Duel.HintSelection(sg1) sg:Merge(sg1) end if g2:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(id,3))) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg2=g2:RandomSelect(tp,1) sg:Merge(sg2) end Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end