--Mecha Blade Technoshield local m=88880120 local cm=_G["c"..m] function cm.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,1)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCost(cm.descost) e1:SetTarget(cm.destg) e1:SetOperation(cm.desop) c:RegisterEffect(e1) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(m,0)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,m) e3:SetCost(cm.thcost) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) end function cm.rmfilter(c,tp) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0xffd) and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(100) return true end function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsOnField() end if chk==0 then if e:GetLabel()==100 then e:SetLabel(0) return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_MZONE,0,1,tp) and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) else return false end end local rt=Duel.GetTargetCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local max=2 if rt>max then rt=2 end local ct=0 local min=1 while ct