--Felgrandrise Blademaster --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --fusion summon c:EnableReviveLimit() aux.AddFusionProcFunRep2(c,cid.ffilter,2,2,true) --change atk local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCondition(cid.atkcon) e1:SetTarget(cid.atktg) e1:SetOperation(cid.atkop) c:RegisterEffect(e1) --double atk local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id+100) e2:SetCondition(cid.spcon) e2:SetOperation(cid.spop) c:RegisterEffect(e2) --spsummon (equip) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,id+200) e3:SetCondition(cid.sscon) e3:SetCost(cid.sscost) e3:SetTarget(cid.sstg) e3:SetOperation(cid.ssop) c:RegisterEffect(e3) end --FILTERS function cid.afilter(c) return c:GetAttack()>0 end function cid.ffilter(c,fc) return c:IsFusionSetCard(0xfe9) or c:IsFusionCode(table.unpack(c43954163.FELGRAND)) end --CHANGE ATK function cid.atkfilter(c) return c:GetAttack()>0 or c:GetColumnGroup():IsExists(cid.afilter,1,nil) end ------------ function cid.atkcon(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE end function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chkc then return chkc:IsOnField() and cid.atkfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.atkfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and c:GetAttack()>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,cid.atkfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not tc or not tc:IsRelateToEffect(e) then return end local g=tc:GetColumnGroup():Filter(cid.afilter,nil) if not g:IsContains(tc) then g:AddCard(tc) end if #g>0 and c:IsRelateToEffect(e) and c:IsFaceup() then local tg,val=g:GetFirst(),math.ceil(c:GetAttack()/2) while tg do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(-val) tg:RegisterEffect(e1) tg=g:GetNext() end end end --DOUBLE ATK function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(c:GetAttack()*2) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BATTLED) e2:SetOperation(cid.caop1) e2:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_DAMAGE_STEP_END) e3:SetOperation(cid.caop2) e3:SetLabelObject(e2) e3:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e3) end function cid.caop1(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if e:GetHandler()==a and d and d:IsDefensePos() then e:SetLabel(1) else e:SetLabel(0) end end function cid.caop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if e:GetLabelObject():GetLabel()==1 and c:IsRelateToBattle() and c:IsChainAttackable() then Duel.ChainAttack() end end --SPSUMMON (EQUIP) function cid.ssfilter(c,e,tp) return (c:IsSetCard(0xfe9) or c:IsCode(table.unpack(c43954163.FELGRAND))) and c:IsType(TYPE_MONSTER) and c:IsAttackAbove(1800) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end ------------------ function cid.sscon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and ec:IsType(TYPE_MONSTER) end function cid.sscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) end function cid.sstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.ssfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetChainLimit(cid.chlimit) end function cid.chlimit(e,ep,tp) return tp==ep end function cid.ssop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=Duel.GetMatchingGroup(cid.ssfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if ft<1 or g:GetCount()==0 then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,2)) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end