--Havendream --Sognoasi --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --[[Target 1 "Number i" monster you control; it gains ATK equal to its Rank x 300, also it is unaffected by other card effects this turn, except its own.]] local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET|EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:HOPT(true) e1:SetRelevantTimings() e1:SetFunctions(s.condition,nil,s.target,s.activate) c:RegisterEffect(e1) end --FE1 function s.filter(c) return c:IsFaceup() and c:IsSetCard(ARCHE_NUMBER_I) and c:HasRank() end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) if #g>0 then local tc=g:GetFirst() local p,loc=tc:GetControler(),tc:GetLocation() Duel.SetCustomOperationInfo(0,CATEGORY_ATKCHANGE,tc,1,p,loc,tc:GetRank()*300) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() and tc:IsFaceup() then if tc:HasRank() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(tc:GetRank()*300) tc:RegisterEffect(e1) end local e2=Effect.CreateEffect(c) e2:SetDescription(STRING_UNAFFECTED_BY_OTHER_EFFECT) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE|EFFECT_FLAG_CLIENT_HINT) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetValue(s.efilter) e2:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END) tc:RegisterEffect(e2) end end function s.efilter(e,te) return te:GetOwner()~=e:GetOwner() end