--Tossina Verde del Mondoassillo || Green Toxin of Worldsbane --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --qp activate during oppo's turn local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.actcon) c:RegisterEffect(e2) end --activate function s.cfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_REPTILE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.filter(c) return c:IsFaceup() and not c:IsRace(RACE_REPTILE) or c:GetFlagEffect(id)<=0 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_MONSTER) then if tc:GetFlagEffect(id)==0 then tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end local e0=Effect.CreateEffect(e:GetHandler()) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_CHANGE_RACE) e0:SetValue(RACE_REPTILE) e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e0) aux.CannotBeEDMaterial(tc,s.matlimit,nil,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,e:GetHandler()) end end function s.matlimit(c) return c:IsRace(RACE_REPTILE) end --qp act function s.qpfilter(c) return c:IsFacedown() or (c:IsType(TYPE_MONSTER) and not c:IsRace(RACE_REPTILE)) end function s.actcon(e) return not Duel.IsExistingMatchingCard(s.qpfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end