--Leggenda Bushido Behemoth --Scripted by: XGlitchy30 local s,id = GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACES_BEASTS),8,2) c:MustFirstBeSummoned(SUMMON_TYPE_XYZ) --protection local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetCode(EFFECT_IMMUNE_EFFECT) e0:SetRange(LOCATION_MZONE) e0:SetValue(s.efilter) c:RegisterEffect(e0) --stats c:UpdateATKDEF(aux.ForEach(s.filter,LOCATION_MZONE,nil,true,100)) --attack while in defense position c:CanAttackWhileInDefensePosition(nil,nil,aux.HasXyzMaterialCond) --destroy replace local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EFFECT_DESTROY_REPLACE) e3:SetRange(LOCATION_MZONE) e3:SetTarget(s.reptg) e3:SetValue(s.repval) e3:SetOperation(s.repop) c:RegisterEffect(e3) end function s.efilter(e,te) local tc=te:GetOwner() return te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()==1-e:GetHandlerPlayer() and (tc:IsSummonType(SUMMON_TYPE_SPECIAL) or te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACES_BEASTS) end function s.repfilter(c,tp) return c:IsFaceup() and c:IsRace(RACES_BEASTS) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE) and not c:IsReason(REASON_REPLACE) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end return Duel.SelectEffectYesNo(tp,c,96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,tp,id) Duel.Hint(HINT_CARD,1-tp,id) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT) end