--Le Impersonificazioni del Moto --Scripted by: XGlitchy30 local s,id = GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddFusionProcCode2(c,34848,34847,true,true) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:HOPT() e1:SetCondition(aux.FusionSummonedCond) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --protection local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_DRIVE)) e2:SetValue(1) c:RegisterEffect(e2) local e2x=e2:Clone() e2x:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2x:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) c:RegisterEffect(e2x) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:HOPT() e3:SetCondition(s.negcon) e3:SetCost(s.negcost) e3:SetTarget(s.negtg) e3:SetOperation(s.negop) c:RegisterEffect(e3) end function s.thfil(c,tp) return c:IsMonster(TYPE_DRIVE) and c:IsAbleToHand() and c:IsCanEngage(tp) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfil,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.thfil,tp,LOCATION_DECK,0,1,1,nil,tp) if #g>0 then local tc=g:GetFirst() if Duel.Search(g,tp)>0 and tc:IsLocation(LOCATION_HAND) and tc:IsCanEngage(tp) then tc:Engage(e,tp) end end end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev) end function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) local en=Duel.GetEngagedCard(tp) if chk==0 then return en and en:IsCanChangeEnergy(0,tp,REASON_COST) end en:ChangeEnergy(0,tp,REASON_COST,0,e:GetHandler()) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsRelateToChain(ev) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToChain(ev) then Duel.Destroy(eg,REASON_EFFECT) end end