--created & coded by Lyris, art by hiliuyun of DeviantArt --剣主一リク local s,id,o=GetID() function s.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_PIERCE) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(s.val) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_XMATERIAL) e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e3:SetCondition(function(e) local tc=e:GetHandler() local bc=tc:GetBattleTarget() return tc:IsSetCard(0xbb2) and Duel.GetAttacker()==tc and bc and bc:IsDefensePos() end) e3:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) c:RegisterEffect(e3) end function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(0xbb2) end function s.val(e,c) return Duel.GetMatchingGroupCount(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)*100 end function s.filter(c,e,tp) return c:IsSetCard(0xbb2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE,0,nil,e,tp) if #sg>0 and Duel.SelectYesNo(tp,2) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=sg:Select(tp,1,1,nil):GetFirst() Duel.BreakEffect() Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end end