--一人千面·米莱迪 function c40006879.initial_effect(c) c:SetUniqueOnField(1,0,40006879) --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(40006879,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,40006879) e1:SetTarget(c40006879.eqtg) e1:SetOperation(c40006879.eqop) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40006879,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,40006880) e2:SetCost(c40006879.cost) e2:SetTarget(c40006879.target) e2:SetOperation(c40006879.operation) c:RegisterEffect(e2) c40006879.discard_effect=e2 --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(40006879,2)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(c40006879.negcon) e3:SetCost(c40006879.negcost) e3:SetTarget(c40006879.negtg) e3:SetOperation(c40006879.negop) c:RegisterEffect(e3) end function c40006879.filter(c) return c:IsFaceup() end function c40006879.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40006879.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c40006879.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c40006879.filter,tp,LOCATION_MZONE,0,1,1,nil) end function c40006879.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(c40006879.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(2100) 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(2500) c:RegisterEffect(e4) end function c40006879.eqlimit(e,c) return c==e:GetLabelObject() end function c40006879.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 c40006879.ctfilter(c,e,tp) return c:IsSetCard(0xdf1d) and not c:IsCode(40006879) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c40006879.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c40006879.ctfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c40006879.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c40006879.ctfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1,true) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE_FINAL) tc:RegisterEffect(e2,true) Duel.SpecialSummonComplete() end end function c40006879.negcost(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 c40006879.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp and re:IsActiveType(TYPE_SPELL) and Duel.IsChainNegatable(ev) end function c40006879.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) end function c40006879.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end end