1 Star 0 Fork 0

Alanisia/ygopro-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
c15717011.lua 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
mercury233 提交于 2020-01-04 15:55 . update new rule (#1291)
--融合呪印生物-光
function c15717011.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(15717011,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(0)
e1:SetCost(c15717011.cost)
e1:SetTarget(c15717011.target)
e1:SetOperation(c15717011.operation)
c:RegisterEffect(e1)
--fusion substitute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_FUSION_SUBSTITUTE)
e2:SetCondition(c15717011.subcon)
c:RegisterEffect(e2)
end
function c15717011.subcon(e)
return e:GetHandler():IsLocation(0x1e)
end
function c15717011.filter(c,e,tp,m,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function c15717011.mfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsCanBeFusionMaterial() and (c:IsControler(tp) or c:IsFaceup())
end
function c15717011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c15717011.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local chkf=tp+0x100
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
local mg=Duel.GetReleaseGroup(tp):Filter(c15717011.mfilter,nil,tp)
return Duel.IsExistingMatchingCard(c15717011.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,c,chkf)
end
local mg=Duel.GetReleaseGroup(tp):Filter(c15717011.mfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c15717011.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg,c,chkf)
local mat=Duel.SelectFusionMaterial(tp,g:GetFirst(),mg,c,chkf)
Duel.Release(mat,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c15717011.filter2(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c15717011.operation(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
local tc=Duel.GetFirstMatchingCard(c15717011.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,code)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
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

搜索帮助

0d507c66 1850385 C8b1a773 1850385