--Mezka Shizue function c31157208.initial_effect(c) aux.AddLinkProcedure(c,c31157208.mfilter,2,2) c:EnableReviveLimit() --atk/def local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetCost(c31157208.adcost) e1:SetTarget(c31157208.adtg) e1:SetOperation(c31157208.adop) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(c31157208.atkval) c:RegisterEffect(e2) --search local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(31157208,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,31157208) e3:SetCondition(c31157208.thcon) e3:SetTarget(c31157208.thtg) e3:SetOperation(c31157208.thop) c:RegisterEffect(e3) end function c31157208.mfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_MACHINE) end function c31157208.cfilter(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) end function c31157208.atkval(e,c) return Duel.GetMatchingGroupCount(c31157208.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)*100 end function c31157208.cfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost() end function c31157208.adcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c31157208.cfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c31157208.cfilter,tp,LOCATION_DECK,0,1,1,nil) local tc=g:GetFirst() Duel.SendtoGrave(tc,REASON_COST) e:SetLabel(tc:GetLevel()) end function c31157208.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function c31157208.adop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local lv=e:GetLabel() --atkdown local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-100*lv) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) --defdown local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end function c31157208.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c31157208.thfilter(c) return c:IsSetCard(0xc70) and c:IsAbleToHand() end function c31157208.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c31157208.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c31157208.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c31157208.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end