--Soldier of White Army --scripted by Rawstone local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() aux.AddFusionProcFun2(c,s.ffilter,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),true) --splimit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetRange(LOCATION_EXTRA) e1:SetValue(s.splimit) c:RegisterEffect(e1) --Search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCost(s.rost) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) --Actlimit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_ACTIVATE) e3:SetTargetRange(0,1) e3:SetValue(s.aclimit) e3:SetCondition(s.actcon) c:RegisterEffect(e3) --disable local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_ATTACK_ANNOUNCE) e4:SetCondition(s.discon) e4:SetOperation(s.disop) c:RegisterEffect(e4) --raigeki local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetCategory(CATEGORY_DESTROY) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_BATTLE_DESTROYING) e5:SetCondition(s.descon) e5:SetTarget(s.destg) e5:SetOperation(s.desop) c:RegisterEffect(e5) end function s.ffilter(c) return c:IsRace(RACE_WARRIOR) and c:IsFusionAttribute(ATTRIBUTE_LIGHT) end function s.splimit(e,se,sp,st) return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION end function s.rfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost() end function s.rost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.filter(c) return c:IsLevelBelow(4) and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) 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_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then if Duel.SendtoHand(g,nil,REASON_EFFECT) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit1) Duel.RegisterEffect(e1,tp) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) end end end function s.splimit1(e,c) return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) end function s.aclimit(e,re,tp) return re:IsActiveType(TYPE_MONSTER) end function s.eqcon2(e) return e:GetHandler():GetEquipGroup():IsExists(Card.IsCode,1,nil,49306994) end function s.actcon(e) local c=e:GetHandler() return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and s.eqcon2(e) end function s.discon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and s.eqcon2(e) end function s.disfilter(c) return aux.disfilter1(c) and c:IsType(TYPE_MONSTER) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.disfilter,tp,0,LOCATION_ONFIELD,c) local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE) tc:RegisterEffect(e2) tc=g:GetNext() end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if a~=c then d=a end return c:IsRelateToBattle() and c:IsFaceup() end function s.filter2(c) return c:IsType(TYPE_MONSTER) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter2,tp,0,LOCATION_ONFIELD,1,nil) end local sg=Duel.GetMatchingGroup(s.filter2,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) Duel.Destroy(g,REASON_EFFECT) end