--Lifichor Failures local cid,id=GetID() function cid.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --token local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetTarget(cid.tktg) e1:SetOperation(cid.tkop) c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetTarget(cid.rectg) e2:SetOperation(cid.recop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCondition(cid.spcon) e4:SetTarget(cid.sptg) e4:SetOperation(cid.spop) c:RegisterEffect(e4) end function cid.cfilter(c,tp) return c:IsFaceup() and c:IsAttackAbove(1) and c:IsDefenseAbove(1) and Duel.IsPlayerCanSpecialSummonMonster(tp,93818599,0xda2,0x4011,c:GetDefense(),c:GetAttack(),3,RACE_ZOMBIE,ATTRIBUTE_DARK) end function cid.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cid.tkfilter(chkc,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cid.tkfilter,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,cid.tkfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) end function cid.tkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if not tc:IsRelateToEffect(e) or not tc:IsFaceup() then return end local atk=tc:GetAttack() or 0 local def=tc:GetDefense() or 0 local val=math.max(atk,def) if Duel.Damage(tp,val,REASON_EFFECT)~=0 and Duel.IsPlayerCanSpecialSummonMonster(tp,93818599,0xda2,0x4011,def,atk,3,RACE_ZOMBIE,ATTRIBUTE_DARK) then local token=Duel.CreateToken(tp,93818599) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(def) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD) token:RegisterEffect(e1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_DEFENSE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(atk) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD) token:RegisterEffect(e1) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) end end function cid.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDestructable() end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) end function cid.recop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then Duel.Recover(tp,500,REASON_EFFECT) end end function cid.spfilter(c,e,tp) return (c:IsSetCard(0x1da2) or c:IsCode(93818602) or c:IsType(TYPE_BIGBANG)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetPreviousControler()==tp and rp==1-tp end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end