1 Star 0 Fork 0

Alanisia/ygopro-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
c15462014.lua 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
mercury233 提交于 2020-03-26 15:24 . add cards DUOV
--Hollow Giants
function c15462014.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c15462014.actcon)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c15462014.distg)
c:RegisterEffect(e2)
--send to GY
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c15462014.tgcon)
e3:SetTarget(c15462014.tgtg)
e3:SetOperation(c15462014.tgop)
c:RegisterEffect(e3)
end
function c15462014.cfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c15462014.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c15462014.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c15462014.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c15462014.distg(e,c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c15462014.egfilter(c)
local d=c:GetBattleTarget()
return c:GetSummonLocation()==LOCATION_EXTRA and d:GetSummonLocation()==LOCATION_EXTRA
end
function c15462014.pcheck(c,tp)
return c:GetPreviousControler()==tp
end
function c15462014.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c15462014.egfilter,1,nil)
end
function c15462014.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
local tg,pct,player=eg:Filter(c15462014.egfilter,nil),0,0
for p=0,1 do
if tg:IsExists(c15462014.pcheck,1,nil,p) then
pct=pct+1
player=p
end
end
if pct==2 then player=PLAYER_ALL end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,player,1000)
end
function c15462014.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
local tg=eg:Filter(c15462014.egfilter,nil)
for p=0,1 do
if tg:IsExists(c15462014.pcheck,1,nil,p) then
Duel.Damage(p,1000,REASON_EFFECT,true)
end
end
Duel.RDComplete()
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

搜索帮助