Commit 96914290 authored by wind2009's avatar wind2009

Fix ダークリボー

parent b12a8794
Pipeline #33494 passed with stages
in 1 minute and 10 seconds
No preview for this file type
--ダークリボー
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,24094653)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetCondition(s.indcon1)
e1:SetCost(s.indcost)
......@@ -25,6 +26,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
......@@ -32,14 +34,15 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
function s.cfilter(c,tp)
return c:IsFaceupEx() and c:IsRace(RACE_FIEND) and c:IsControler(tp)
return c:IsFaceupEx() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and (c:IsRace(RACE_FIEND) or c:IsAllTypes(TYPE_FUSION+TYPE_MONSTER))
end
function s.indcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.indcon2(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return d:IsFaceup() and d:IsRace(RACE_FIEND) and d:IsControler(tp)
return d and s.cfilter(d,tp)
end
function s.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -64,8 +67,8 @@ function s.indtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_MONSTER) then
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
......@@ -76,11 +79,13 @@ function s.indop(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e3:SetValue(s.effectfilter)
e3:SetLabelObject(tc)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment