--Automate IDlocal s,id=GetID()function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(69001,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_IGNITION) e1:SetCategory(CATEGORY_RECOVER) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1,id) e1:SetRange(LOCATION_HAND) e1:SetCost(s.reccost) e1:SetTarget(s.rectg) e1:SetOperation(s.recop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_LIMIT_SUMMON_PROC) e2:SetCondition(s.sumcon) c:RegisterEffect(e2) local e2=e2:Clone() e2:SetCode(EFFECT_LIMIT_SET_PROC) c:RegisterEffect(e2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) e1:SetValue(2000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_BASE_DEFENSE) c:RegisterEffect(e2) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(aux.bdocon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_XMATERIAL) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetCondition(s.indcon) e2:SetValue(1) c:RegisterEffect(e2) end function s.reccost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsPublic() end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_PUBLIC) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500) end function s.recop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end function s.sumcon(e,c,minc) if not c then return true end return not e:GetHandler():IsPublic() end function s.atkcon(e) local tp=e:GetHandlerPlayer() return Duel.GetLP(tp)>Duel.GetLP(1-tp) end function s.filter(c,tp) return c:IsCode(69010) and c:GetActivateEffect():IsActivatable(tp,true,true) end function s.spfilter(c,e,tp) return c:IsSetCard(0x6969) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) if chk==0 then return a or Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,tp) end if a then e:SetCategory(CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end end function s.spop(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) local b=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,tp) if a and b then op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) elseif a then op=0 elseif b then op=1 else return end if op==0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g1=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g1>0 then Duel.SpecialSummon(g1,0,tp,tp,false,false) end elseif op==1 then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() if tc then local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) if fc then Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect() end Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) local te=tc:GetActivateEffect() te:UseCountLimit(tp,1,true) local tep=tc:GetControler() local cost=te:GetCost() if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain()) end end end function s.indfilter(c) return c:IsFaceup() and c:IsCode(69010) end function s.indcon(e) return e:GetHandler():IsAttribute(ATTRIBUTE_WATER) and e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(s.indfilter,e:GetOwnerPlayer(),LOCATION_SZONE,0,1,nil) end