--SWAM-一人千面 function c40008874.initial_effect(c) c:SetUniqueOnField(1,0,40008874) aux.EnablePendulumAttribute(c) --splimit local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetRange(LOCATION_PZONE) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e0:SetTargetRange(1,0) e0:SetTarget(c40008874.psplimit) c:RegisterEffect(e0) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(40008874,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,40008874) e1:SetCost(c40008874.spcost) e1:SetTarget(c40008874.sptg) e1:SetOperation(c40008874.spop) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(40008874,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,40008875) e2:SetCost(c40008874.setcost) e2:SetTarget(c40008874.settg) e2:SetOperation(c40008874.setop) c:RegisterEffect(e2) c40008874.discard_effect=e2 --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(40008874,2)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_TO_DECK) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCountLimit(1,40008876) e3:SetCondition(c40008874.pencon) e3:SetTarget(c40008874.pentg) e3:SetOperation(c40008874.penop) c:RegisterEffect(e3) end function c40008874.psplimit(e,c,tp,sumtp,sumpos) return not c:IsRace(RACE_PSYCHO) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function c40008874.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,1,nil) if g:GetFirst():IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,g) end Duel.SendtoDeck(g,tp,2,REASON_COST) end function c40008874.spfilter(c,e,tp) return c:IsCode(40008877) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function c40008874.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and Duel.IsExistingMatchingCard(c40008874.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_PZONE+LOCATION_DECK) end function c40008874.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c40008874.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then g:AddCard(e:GetHandler()) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function c40008874.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 c40008874.setfilter(c) return c:IsCode(40008877) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() end function c40008874.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(c40008874.setfilter,tp,LOCATION_DECK,0,1,nil) end end function c40008874.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local g=Duel.SelectMatchingCard(tp,c40008874.setfilter,tp,LOCATION_DECK,0,1,1,nil) local tc=g:GetFirst() if tc then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end end function c40008874.pencon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0xdf1d) and not re:GetHandler():IsCode(40008874) end function c40008874.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end end function c40008874.penop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) end end