--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) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(22835145,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCondition(function(e,tp) return Duel.GetLP(tp)>Duel.GetLP(1-tp) end) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e2=e2:Clone() e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e2) local e2=e2:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetTarget(s.target0) e2:SetOperation(s.operation0) 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.filter(c,e,tp) return c:IsSetCard(0x6969) and not c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function s.cfilter(c) return c:IsSetCard(0x6969) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) end function s.target0(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and s.cfilter(chkc) and c:IsControler(tp) end if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and e:GetHandler():IsAttribute(ATTRIBUTE_WATER) and Duel.IsExistingTarget(s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil) end function s.operation0(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then Duel.Overlay(c,Group.FromCards(tc)) end end