--Lifefoster Hope, Buraq local cid,id=GetID() function cid.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1) e1:SetTarget(cid.rectg) e1:SetOperation(cid.recop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetCost(cid.thcost) e2:SetTarget(cid.thtg) e2:SetOperation(cid.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --recover local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_RECOVER) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,id+100) e4:SetCost(cid.ireccost) e4:SetTarget(cid.irectg) e4:SetOperation(cid.irecop) c:RegisterEffect(e4) end function cid.recfilter(c) return c:IsFaceup() and c:GetAttack()>0 end function cid.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cid.recfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.recfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,cid.recfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,math.floor(g:GetFirst():GetAttack()/2)) end function cid.recop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then Duel.Recover(tp,math.floor(tc:GetAttack()/2),REASON_EFFECT) end end function cid.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,1000) end Duel.PayLPCost(tp,1000) end function cid.thfilter(c) return (c:IsSetCard(0x1da2) or c:IsCode(93818602)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.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 function cid.ireccost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsReleasable() end Duel.Release(c,REASON_COST) end function cid.irecfilter(c) return c:IsFaceup() and c:IsSetCard(0xda2) end function cid.irectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cid.irecfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.irecfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,cid.irecfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetLevel()) end function cid.irecop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetLevel()>0 then Duel.Recover(tp,tc:GetLevel()*200,REASON_EFFECT) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetValue(aux.indoval) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end end