1 Star 0 Fork 0

Alanisia/ygopro-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
c14536035.lua 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
dest 提交于 2018-05-18 00:36 . update level/rank/link functions (#1055)
--ダーク・グレファー
function c14536035.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14536035,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c14536035.spcon)
e1:SetOperation(c14536035.spop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(14536035,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c14536035.sgcost)
e2:SetTarget(c14536035.sgtg)
e2:SetOperation(c14536035.sgop)
c:RegisterEffect(e2)
end
function c14536035.spfilter(c)
return c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c14536035.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c14536035.spfilter,c:GetControler(),LOCATION_HAND,0,1,c)
end
function c14536035.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c14536035.spfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST)
end
function c14536035.costfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsDiscardable()
end
function c14536035.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c14536035.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c14536035.costfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c14536035.filter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function c14536035.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c14536035.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c14536035.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c14536035.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alanisia/ygopro-scripts.git
git@gitee.com:alanisia/ygopro-scripts.git
alanisia
ygopro-scripts
ygopro-scripts
master

搜索帮助