--Dimenticalgia Sacerdotessa Pikeru --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --spsummon self local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) local e1x=e1:Clone() e1x:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e1x) local e1y=e1:Clone() e1y:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e1y) --token local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCountLimit(1,id+100) e2:SetCondition(cid.tkcon) e2:SetTarget(cid.tktg) e2:SetOperation(cid.tkop) c:RegisterEffect(e2) end --filters function cid.spfilter(c,tp) return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp and c:IsSetCard(0xf45) and c:IsAttackAbove(1) end --spsummon self function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cid.spfilter,1,nil,tp) and #eg==1 end function cid.sptg(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 c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE) end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,eg:GetFirst():GetAttack()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then if Duel.Damage(tp,eg:GetFirst():GetAttack(),REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:GetSummonLocation()==LOCATION_GRAVE then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end end end end --token function cid.tkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():GetReasonCard():IsSetCard(0xf45) end function cid.tktg(e,tp,eg,ep,ev,re,r,rp,chk) local rc=e:GetHandler():GetReasonCard() if chk==0 then return rc and rc:IsLocation(LOCATION_MZONE) and rc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0xf45,0x4011,rc:GetAttack(),rc:GetDefense(),rc:GetLevel(),rc:GetRace(),rc:GetAttribute()) end Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rc:GetAttack()) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) end function cid.tkop(e,tp,eg,ep,ev,re,r,rp) local rc=e:GetHandler():GetReasonCard() if not rc:IsLocation(LOCATION_MZONE) or not rc:IsFaceup() then return end if Duel.Recover(tp,rc:GetAttack(),REASON_EFFECT)~=0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0xf45,0x4011,rc:GetAttack(),rc:GetDefense(),rc:GetLevel(),rc:GetRace(),rc:GetAttribute()) then local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetValue(rc:GetAttack()) e1:SetReset(RESET_EVENT+RESETS_STANDARD) token:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_BASE_DEFENSE) e2:SetValue(rc:GetDefense()) token:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EFFECT_CHANGE_LEVEL) e3:SetValue(rc:GetLevel()) token:RegisterEffect(e3) local e4=e1:Clone() e4:SetCode(EFFECT_CHANGE_RACE) e4:SetValue(rc:GetRace()) token:RegisterEffect(e4) local e5=e1:Clone() e5:SetCode(EFFECT_CHANGE_ATTRIBUTE) e5:SetValue(rc:GetAttribute()) token:RegisterEffect(e5) Duel.SpecialSummonComplete() end end end