--Pahialiah, Chierico Ængelico || Pahialiah, Ængelic Cleric --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --battle protection local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_BATTLE_CONFIRM) e1:SetCountLimit(1,id) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id+100) e2:SetCondition(s.drcon) e2:SetTarget(s.drtg) e2:SetOperation(s.drawop) c:RegisterEffect(e2) end --battle protection function s.condition(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local b=a:GetBattleTarget() if not b then return false end if a:IsControler(1-tp) then a,b=b,a end return a:GetControler()~=b:GetControler() and a:IsType(TYPE_MONSTER) and a:IsFaceup() and a:IsSetCard(0xae6) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsPublic() and c:GetFlagEffect(id)==0 end c:RegisterFlagEffect(id,RESET_CHAIN,0,1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return e:GetHandler():IsAbleToRemove(tp,POS_FACEDOWN) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsAbleToRemove(tp,POS_FACEDOWN) and Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)~=0 then local a=Duel.GetAttacker() local b=a:GetBattleTarget() if a:IsControler(1-tp) then a,b=b,a end if a:IsRelateToBattle() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE) a:RegisterEffect(e1) end end end --draw function s.drcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_REMOVED) and c:IsPreviousPosition(POS_FACEDOWN) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drawop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end