--Summoned Knight function c155255.initial_effect(c) --Change Code local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_GRAVE+LOCATION_MZONE) e1:SetValue(70781052) c:RegisterEffect(e1) --Special Summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(c155255.spcon) e2:SetOperation(c155255.spop) e2:SetValue(1) c:RegisterEffect(e2) --Indes local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(155255,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetOperation(c155255.effop) e3:SetCondition(c155255.spcon2) c:RegisterEffect(e3) --control local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(155255,1)) e4:SetCategory(CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,155255) e4:SetCondition(c155255.adcon) e4:SetTarget(c155255.adtg) e4:SetOperation(c155255.adop) c:RegisterEffect(e4) end function c155255.spfilter(c) return c:IsFaceup() and c:IsRace(RACE_FIEND) and c:IsDestructable() end function c155255.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(c155255.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function c155255.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,c155255.spfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Destroy(g,REASON_EFFECT) end function c155255.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end function c155255.filter(c) return c:IsFaceup() and c:IsRace(RACE_FIEND) end function c155255.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(c155255.filter,tp,LOCATION_MZONE,0,nil) local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(c155255.valcon) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2) tc:RegisterEffect(e1) tc=g:GetNext() end end function c155255.valcon(e,re,r,rp) return bit.band(r,REASON_EFFECT)~=0 and ep~=tp end function c155255.adcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c155255.adfilter(c) return c:IsRace(RACE_FIEND) and c:IsAbleToHand() end function c155255.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c155255adfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c155255.adfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c155255.adfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500) end function c155255.adop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then Duel.Damage(tp,500,REASON_EFFECT) end end