--Hysteria Psychic Android --Scripted by Zerry local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials aux.AddFusionProcCodeFun(c,19251408,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),1,true,true) --Negate & set local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_CHAINING) e1:SetCountLimit(1) e1:SetCondition(s.negcon) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) --Replace local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.reptg) e2:SetOperation(s.repop) c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DESTROYED) e3:SetCondition(s.spcon) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.material_type=TYPE_SYNCHRO function s.synchro_fusion_check(tp,sg,fc) return aux.gffcheck(sg,Card.IsFusionCode,19251408,Card.IsRace,RACE_PSYCHO) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return re:GetActivateLocation()==LOCATION_GRAVE+LOCATION_REMOVED and Duel.IsChainNegatable(ev) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsRelateToEffect(re) then local cat=e:GetCategory() if re:GetHandler():GetOriginalType()&TYPE_MONSTER~=0 then e:SetCategory(cat|CATEGORY_SPECIAL_SUMMON) else e:SetCategory(cat&~CATEGORY_SPECIAL_SUMMON) end end end function s.negop(e,tp,eg,ep,ev,re,r,rp) local rc=re:GetHandler() if rc:IsRelateToEffect(re) and Duel.NegateActivation(ev)~=0 and aux.nvfilter(rc) then if (rc:IsType(TYPE_MONSTER) and ((rc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0) or (not rc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))) and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.ConfirmCards(1-tp,rc) elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.SSet(tp,rc) end end end function s.repfilter(c,e) return c:IsPosition(POS_FACEDOWN) and c:IsAbleToGrave() end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_ONFIELD,0,1,c,e) end if Duel.SelectEffectYesNo(tp,c,96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_ONFIELD,0,1,1,c,e) e:SetLabelObject(g:GetFirst()) return true else return false end end function s.repop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.SendtoGrave(tc, REASON_EFFECT+REASON_REPLACE) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.spfilter(c,e,tp) return c:IsCode(19251408) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end