--巴林杰之异星到来者 local m=40009928 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+CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,m) e1:SetCost(cm.spcost) e1:SetCondition(cm.spcon) e1:SetTarget(cm.sptg) e1:SetOperation(cm.spop) c:RegisterEffect(e1) --atk/def local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetValue(cm.atkvalue) c:RegisterEffect(e4) end function cm.Foreigner(c) local m=_G["c"..c:GetCode()] return m and m.named_with_Foreigner end function cm.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end function cm.cfilter(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.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,2,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 Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cm.defilter(c) return c:IsCode(40009938,40009939,40009940,40009941) and c:IsFaceup() end function cm.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then local sg=Duel.GetMatchingGroup(cm.drfilter,tp,LOCATION_REMOVED,0,nil) if sg:GetCount()>0 then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end end function cm.rmfilter(c) return c:IsFaceup() and c:IsCode(40009938,40009939,40009940,40009941) end function cm.atkvalue(e,c) return Duel.GetMatchingGroupCount(cm.rmfilter,c:GetControler(),LOCATION_REMOVED,0,nil)*200 end