--Legends and Myths, Valour local s,id=GetID() function s.initial_effect(c) --act in hand local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_TRAP_ACT_IN_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.actcon) c:RegisterEffect(e1) --activate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetTarget(s.pentg) e2:SetOperation(s.penop) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_START) e3:SetCountLimit(1,id+2) e3:SetRange(LOCATION_SZONE) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end function s.actfilter(c) return c:IsFaceup() and c:IsSetCard(0x190) and c:IsType(TYPE_LINK) and c:IsLinkAbove(3) end function s.actcon(e) return Duel.IsExistingMatchingCard(s.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.penfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0xFA0) end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if Duel.GetFlagEffect(tp,id)>0 then return false end if chk==0 then return true end end function s.penop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or not Duel.IsExistingMatchingCard(s.penfilter,tp,LOCATION_PZONE,0,1,nil,e,tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) local g=Duel.SelectMatchingCard(tp,s.penfilter,tp,LOCATION_PZONE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetAttacker() local bc=Duel.GetAttackTarget() if not bc then return false end if tc:IsControler(1-tp) then tc,bc=bc,tc end if tc:IsType(TYPE_MONSTER) then e:SetLabelObject(bc) return true else return false end end function s.desfilter(c,e,tp) return c:IsDestructable() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_MZONE,0,1,nil) end local bc=e:GetLabelObject() Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local bc=e:GetLabelObject() local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil) local tc=g:GetFirst() if bc and tc and bc:IsRelateToBattle() then Duel.Destroy(bc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT) end end