--Rainshine Embodiment local ref,id=GetID() function ref.initial_effect(c) c:EnableReviveLimit() local magick=Effect.CreateEffect(c) magick:SetType(EFFECT_TYPE_CONTINUOUS) magick:SetCode(EVENT_MAGICK) magick:SetProperty(EFFECT_FLAG_DELAY) magick:SetOperation(ref.limop) aux.AddMagickProcCustom(c,ref.confilter,aux.MagickMatCost,magick,ref.mmatfilter,1) aux.AddLinkProcedure(c,ref.lmatfilter,1) --Recover FIRE local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():IsLinkState() end) e1:SetTarget(ref.thtg) e1:SetOperation(ref.thop) c:RegisterEffect(e1) --Revive local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(aux.exccon) e2:SetTarget(ref.sstg) e2:SetOperation(ref.ssop) c:RegisterEffect(e2) end function ref.mmatfilter(c) return c:GetType()==TYPE_SPELL end function ref.lmatfilter(c) return c:IsSummonType(SUMMON_TYPE_NORMAL) and c:IsLinkAttribute(ATTRIBUTE_WATER) end function ref.confilter(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnCount()==2 end function ref.limop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(ref.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(0,1) e2:SetValue(HALF_DAMAGE) e2:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e2,tp) end function ref.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsType(TYPE_MAGICK) and c:IsLink(1) end --Recover function ref.thfilter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand() end function ref.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingTarget(ref.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,ref.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function ref.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end --Revive function ref.sstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function ref.ssop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT,nil)~=0 then if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end end