--诺德林格之异星神 local m=40009926 local cm=_G["c"..m] cm.named_with_Foreigner=1 function cm.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,m) e1:SetCost(cm.spcost) e1:SetTarget(cm.sptg) e1:SetOperation(cm.spop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,m+1) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetCondition(cm.atkcon) e2:SetCost(cm.atkcost) -- e2:SetTarget(cm.atktg) e2:SetOperation(cm.atkop) c:RegisterEffect(e2) end function cm.Foreigner(c) local m=_G["c"..c:GetCode()] return m and m.named_with_Foreigner end function cm.spfilter(c) return c:IsCode(40009938,40009939,40009940,40009941) and c:IsAbleToRemoveAsCost() end function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function cm.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end function cm.costfilter1(c) return c:IsFaceup() and c:IsCode(40009938,40009939,40009940,40009941) and c:IsAbleToGraveAsCost() end function cm.costfilter2(c) return c:IsFaceup() and c:IsCode(40009938,40009939,40009940,40009941) end function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter1,tp,LOCATION_REMOVED,0,1,nil) end -- local ft=Duel.GetMatchingGroup(cm.costfilter2,tp,LOCATION_REMOVED,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_REMOVED,0,1,12,nil) local cg=Duel.SendtoGrave(g,REASON_COST+REASON_RETURN) e:SetLabel(cg) end function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=e:GetLabel() local cat=CATEGORY_ATKCHANGE if ct>=5 then cat=cat+CATEGORY_NEGATE+CATEGORY_REMOVE local ng=Group.CreateGroup() local dg=Group.CreateGroup() for i=1,ev do local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) if tgp~=tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(i) then local tc=te:GetHandler() ng:AddCard(tc) if tc:IsOnField() and tc:IsRelateToEffect(te) and not tc:IsHasEffect(EFFECT_CANNOT_TO_DECK) and Duel.IsPlayerCanSendtoDeck(tp,tc) then dg:AddCard(tc) end end end Duel.SetTargetCard(dg) Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,ng:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,dg,dg:GetCount(),0,0) end e:SetCategory(cat) end function cm.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e)and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1500) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) local ct=e:GetLabel() if ct>=3 or ct>=5 then if ct>=3 and c:IsRelateToEffect(e) then Duel.BreakEffect() local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e2:SetValue(2) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e2) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2)) end if ct>=5 then Duel.BreakEffect() local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_IMMUNE_EFFECT) e4:SetValue(cm.efilter1) e4:SetReset(RESET_EVENT+0x1fe0000+RESET_CHAIN) c:RegisterEffect(e4) end end end end function cm.efilter1(e,te) return te:GetOwner()~=e:GetOwner() end