--Chaos Blader function c249000908.initial_effect(c) --draw local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetCondition(c249000908.condition) e1:SetTarget(c249000908.target) e1:SetOperation(c249000908.operation) c:RegisterEffect(e1) --pierce local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_PIERCE) c:RegisterEffect(e2) --spsummon proc local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c249000908.spcon) c:RegisterEffect(e1) end function c249000908.condition(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function c249000908.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function c249000908.filter(c) return c:IsSetCard(0xcf) or c:IsSetCard(0x1048) or c:IsSetCard(0x1073) end function c249000908.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) Duel.ShuffleHand(p) Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(p,c249000908.filter,p,LOCATION_HAND,0,1,1,nil) local tg=g:GetFirst() if tg then if Duel.SendtoGrave(tg,REASON_EFFECT+REASON_DISCARD)==0 then Duel.ConfirmCards(1-p,tg) Duel.ShuffleHand(p) end else local sg=Duel.GetFieldGroup(p,LOCATION_HAND,0) Duel.SendtoGrave(sg,REASON_EFFECT) end end function c249000908.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)