--Automate ID local 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) --spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e1=e1:Clone() e1:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_XMATERIAL) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetCondition(s.tgcon) e2:SetValue(1) c:RegisterEffect(e2) end function s.reccon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp 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.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x6969) and c:IsControler(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetLP(tp)>Duel.GetLP(1-tp) and eg:IsExists(s.cfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP) end function s.tgcon(e) return e:GetHandler():IsType(TYPE_XYZ) and e:GetHandler():IsAttribute(ATTRIBUTE_WATER) end