--created by LionHeartKIng, coded by Lyris --フェイトヒーロー・リベルティー local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_BE_BATTLE_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCategory(CATEGORY_DESTROY) e2:SetCountLimit(1,id) e2:SetCondition(s.con) e2:SetTarget(s.tg) e2:SetOperation(s.op) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id+o*10) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCost(aux.bfgcost) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() return tc:IsControler(tp) and tc:IsPosition(POS_FACEUP) and tc:IsSetCard(0xa5f) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetAttacker() if chk==0 then return a:IsOnField() end Duel.SetTargetCard(a) Duel.SetOperationInfo(0,CATEGORY_DESTROY,a,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToChain(0) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then Duel.Destroy(tc,REASON_EFFECT) end end function s.filter(c,e,tp) return c:IsSetCard(0xa5f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.op(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP) end