diff --git a/unofficial/c511027563.lua b/unofficial/c511027563.lua new file mode 100644 index 0000000000..198e44f29d --- /dev/null +++ b/unofficial/c511027563.lua @@ -0,0 +1,51 @@ +--異い次じ元げんの一角戦士ユニコーンナイト (Anime) +--D.D. Unicorn Knight (Anime) +--Made by When +local s,id=GetID() +function s.initial_effect(c) + c:EnableReviveLimit() + --special summon + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_SPSUMMON_PROC) + e1:SetRange(LOCATION_HAND) + e1:SetCondition(s.spcon) + e1:SetOperation(s.spop) + c:RegisterEffect(e1) + --choose attacks + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetRange(LOCATION_MZONE) + e1:SetCode(EFFECT_PATRICIAN_OF_DARKNESS) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetTargetRange(0,1) + c:RegisterEffect(e1) +end +function s.spcon(e,c) + if c==nil then return true end + local tp=c:GetControler() + return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) +end +function s.spfilter(c,e,tp) + return c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +end +function s.spop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local c=e:GetHandler() + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,tp,tp,tp,false,false,POS_FACEUP) + local tc=g:GetFirst() + --negate its effects + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_DISABLE) + e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD) + 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_TOFIELD) + tc:RegisterEffect(e2) + end +end