--一人千面·死灵之书 function c40006877.initial_effect(c) c:SetUniqueOnField(1,0,40006877) --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(40006877,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,40006877) e1:SetTarget(c40006877.eqtg) e1:SetOperation(c40006877.eqop) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40006877,1)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,40006878) e2:SetCost(c40006877.cost) e2:SetTarget(c40006877.sptgg) e2:SetOperation(c40006877.spopp) c:RegisterEffect(e2) c40006877.discard_effect=e2 --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(40006877,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCountLimit(1) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_SZONE) e3:SetCost(c40006877.spcost) e3:SetTarget(c40006877.sptg) e3:SetOperation(c40006877.spop) c:RegisterEffect(e3) end function c40006877.filter(c) return c:IsFaceup() end function c40006877.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40006877.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c40006877.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c40006877.filter,tp,LOCATION_MZONE,0,1,1,nil) end function c40006877.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not tc:IsControler(tp) then Duel.SendtoGrave(c,REASON_EFFECT) return end Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c40006877.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) --race local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_CHANGE_RACE) e2:SetValue(RACE_PSYCHO) e2:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e2) --equip effect local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_SET_BASE_DEFENSE) e3:SetValue(900) e3:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e3) --equip effect local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_EQUIP) e4:SetCode(EFFECT_SET_BASE_ATTACK) e4:SetReset(RESET_EVENT+0x1fe0000) e4:SetValue(2100) c:RegisterEffect(e4) end function c40006877.eqlimit(e,c) return c==e:GetLabelObject() end function c40006877.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToDeckAsCost() end if c:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,c) end Duel.SendtoDeck(c,nil,2,REASON_COST) end function c40006877.filter2(c,e,tp) return not c:IsCode(40006877) and c:IsSetCard(0xdf1d) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() end function c40006877.filter3(c,e,tp) return c:IsLocation(LOCATION_MZONE) and c:IsPosition(POS_FACEUP) and c:GetControler()==tp and c:IsType(TYPE_MONSTER) end function c40006877.sptgg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c40006877.filter2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c40006877.filter3,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end local g=Duel.GetMatchingGroup(c40006877.filter2,tp,LOCATION_DECK,0,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) end function c40006877.spopp(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(60151301,3)) local g=Duel.SelectMatchingCard(tp,c40006877.filter3,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.HintSelection(g) local tc=g:GetFirst() if tc:IsImmuneToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(60151301,2)) local g1=Duel.SelectMatchingCard(tp,c40006877.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g1:GetCount()>0 then local tc2=g1:GetFirst() if tc2:IsLocation(LOCATION_GRAVE) then Duel.HintSelection(g1) end Duel.Equip(tp,tc2,tc,true,true) Duel.EquipComplete() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(c40006877.eqlimit2) e1:SetLabelObject(tc) tc2:RegisterEffect(e1) end end end function c40006877.eqlimit2(e,c) return c==e:GetLabelObject() end function c40006877.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end Duel.SendtoGrave(e:GetHandler(),REASON_COST) end function c40006877.spfilter(c,e,tp) return c:IsSetCard(0xdf1d) and c:IsType(TYPE_MONSTER) and not c:IsCode(40006877) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c40006877.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp and c40006877.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c40006877.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c40006877.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c40006877.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end