--奥盖尔之异星降临者 local m=40009944 local cm=_G["c"..m] cm.named_with_Foreigner=1 function cm.initial_effect(c) --disable effect local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_HAND) e1:SetCondition(cm.discon) e1:SetCost(cm.discost) e1:SetTarget(cm.distg) e1:SetOperation(cm.disop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,m) e2:SetCondition(cm.atkcon) e2:SetCost(cm.atkcost) 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.cfilter(c,tp) return c:IsFaceup() and cm.Foreigner(c) and c:IsControler(tp) and c:IsOnField() end function cm.discon(e,tp,eg,ep,ev,re,r,rp) if not (rp==1-tp and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(cm.cfilter,1,nil,tp) and Duel.IsChainDisablable(ev) end function cm.cfilter2(c) return c:IsCode(40009938,40009939,40009940,40009941) and c:IsAbleToRemoveAsCost() end function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() and Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.Remove(g,POS_FACEUP,REASON_COST) end function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not re:GetHandler():IsDisabled() end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function cm.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end function cm.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) end function cm.atkcfilter(c) return c:IsCode(40009938,40009939,40009940,40009941) and c:IsAbleToRemoveAsCost() end function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.atkcfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cm.atkcfilter,tp,LOCATION_DECK,0,1,2,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function cm.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(c:GetBaseAttack()*2) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) end