--一人千面·辛德瑞拉 function c40008877.initial_effect(c) aux.EnablePendulumAttribute(c) --special summon local e0=Effect.CreateEffect(c) e0:SetCategory(CATEGORY_SPECIAL_SUMMON) e0:SetType(EFFECT_TYPE_IGNITION) e0:SetRange(LOCATION_PZONE) e0:SetCountLimit(1,40008877) e0:SetCost(c40008877.setcost) e0:SetCondition(c40008877.spcon) e0:SetTarget(c40008877.thtg) e0:SetOperation(c40008877.thop) c:RegisterEffect(e0) if not c40008877.global_check then c40008877.global_check=true local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_SPSUMMON_SUCCESS) ge1:SetOperation(c40008877.checkop) Duel.RegisterEffect(ge1,0) end --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(40008877,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_EQUIP) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,40008878) e1:SetTarget(c40008877.eqtg) e1:SetOperation(c40008877.eqop) c:RegisterEffect(e1) --apply effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40008877,1)) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,40008879) e2:SetCost(c40008877.setcost) e2:SetTarget(c40008877.efftg) e2:SetOperation(c40008877.effop) c:RegisterEffect(e2) --atk local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(c40008877.atkcon) e3:SetOperation(c40008877.atkop) c:RegisterEffect(e3) end function c40008877.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() while tc and tc:IsSummonType(SUMMON_TYPE_PENDULUM) do Duel.RegisterFlagEffect(tc:GetSummonPlayer(),40008877,RESET_PHASE+PHASE_END,0,1) tc=eg:GetNext() end end function c40008877.lkfilter(c) return not c:IsSummonType(SUMMON_TYPE_PENDULUM) end function c40008877.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(tp,40008877)>=1 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) end function c40008877.setcost(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 c40008877.thfilter(c) return c:IsSetCard(0xdf1d) and not c:IsCode(40008877) and c:IsAbleToHand() end function c40008877.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c40008877.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c40008877.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c40008877.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c40008877.filter(c) return c:IsFaceup() end function c40008877.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40008877.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c40008877.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c40008877.filter,tp,LOCATION_MZONE,0,1,1,nil) end function c40008877.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(c40008877.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(0) 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(0) c:RegisterEffect(e4) end function c40008877.eqlimit(e,c) return c==e:GetLabelObject() end function c40008877.efffilter(c,e,tp,eg,ep,ev,re,r,rp) if not (c:IsSetCard(0xdf1d) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and not c:IsCode(40008877)) then return false end local m=_G["c"..c:GetCode()] if not m then return false end local te=m.discard_effect if not te then return false end local tg=te:GetTarget() return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0) end function c40008877.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsControler(tp) and c40008877.efffilter(chkc,e,tp,eg,ep,ev,re,r,rp) end if chk==0 then return Duel.IsExistingTarget(c40008877.efffilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,c40008877.efffilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) local tc=g:GetFirst() Duel.ClearTargetCard() tc:CreateEffectRelation(e) e:SetLabelObject(tc) local m=_G["c"..tc:GetCode()] local te=m.discard_effect local tg=te:GetTarget() if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end end function c40008877.effop(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetLabelObject() if tc:IsRelateToEffect(e) then local m=_G["c"..tc:GetCode()] local te=m.discard_effect local op=te:GetOperation() if op then op(e,tp,eg,ep,ev,re,r,rp) end Duel.BreakEffect() Duel.SendtoDeck(tc,nil,1,REASON_EFFECT) end end function c40008877.atkcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() local tc=ec:GetBattleTarget() return ec and tc and tc:IsFaceup() and tc:IsControler(1-tp) end function c40008877.atkop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local ec=e:GetHandler():GetEquipTarget() if ec:IsRelateToBattle() and ec:IsFaceup() and ec:IsControler(tp) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(ec:GetAttack()*2) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL) ec:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE_FINAL) e2:SetValue(ec:GetDefense()*2) ec:RegisterEffect(e2) end end