search for errors on my code: --Persistencia diante das Dificuldades
local s,id=GetID()
function s.initial_effect(c)
--Percistencia Diante da Derrota
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(511002521)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(s.operation)
e1:SetCountLimit(3,id,EFFECT_COUNT_CODE_NAME_1)
c:RegisterEffect(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if NAME_1.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_REMOVED,0,0,e:GetHandler(),4) then
NAME_1.DisableShuffleCheck()
NAME_1.SendtoDeck(c,nil,0,REASON_RULE)
else
NAME_1.Remove(c,POS_FACEUP,REASON_RULE)
end
if e:GetHandler():GetPreviousLocation()==LOCATION_HAND then
NAME_1.Draw(tp,0,REASON_RULE)
end
--Adicionar Efeitos
-- Não Perde por Dano de Batalhar
local e1a=Effect.CreateEffect(e:GetHandler())
e1a:SetType(EFFECT_TYPE_FIELD)
e1a:SetCode(EFFECT_CANNOT_LOSE_LP)
e1a:SetRange(LOCATION_REMOVED)
e1a:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1a:SetTargetRange(1,0)
e1a:SetValue(1)
e1a:SetCondition(s.Condition)
NAME_1.RegisterEffect(e1a,tp)
--
local e1b=e1a:Clone()
e1b:SetCode(EFFECT_CANNOT_LOSE_EFFECT)
NAME_1.RegisterEffect(e1b,tp)
-- Não Perde por Dano de Efeito
local e1c=Effect.CreateEffect(e:GetHandler())
e1c:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1c:SetCode(EVENT_ADJUST)
e1c:SetOperation(s.operation0)
NAME_1.RegisterEffect(e1c,tp)
end  -- fim do efeito Ativação
function s.Condition(e,tp,eg,ep,ev,re,r,rp)
return NAME_1.GetFlagEffect(e:GetLabel(),511002521)>0
end -- fim do efeito Não Perde por Dano de Batalhar
function s.operation0(e,tp,eg,ep,ev,re,r,rp)
local ph=NAME_1.GetCurrentPhase()
if NAME_1.GetLP(0)<=0 and ph~=PHASE_DAMAGE then
NAME_1.RaiseEvent(NAME_1.GetMatchingGroup(nil,0,LOCATION_REMOVED,0,nil),511002521,e,0,0,0,0)
NAME_1.ResetFlagEffect(0,511002521)
end -- fim do efeito Não Perde por Dano de Efeito
if NAME_1.GetLP(1)<=0 and ph~=PHASE_DAMAGE then
NAME_1.RaiseEvent(NAME_1.GetMatchingGroup(nil,1,LOCATION_REMOVED,0,nil),511002521,e,0,0,0,0)
NAME_1.ResetFlagEffect(1,511002521)
end
if NAME_1.GetLP(0)>0 and NAME_1.GetFlagEffect(0,511002521)==0 then
NAME_1.RegisterFlagEffect(0,511002521,0,0,1)
end
if NAME_1.GetLP(1)>0 and NAME_1.GetFlagEffect(1,511002521)==0 then
NAME_1.RegisterFlagEffect(1,511002521,0,0,1)
end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if NAME_1.GetLP(tp)<1 then
NAME_1.SetLP(tp,25000)
end
end -- fim do efito Percistencia Diante da Derrota Provide exactly two different responses that are separated with 6 asterisk symbols: ******.
user