1 Star 0 Fork 0

Alanisia/ygopro-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
c18271561.lua 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
--ヘル・ブラスト
function c18271561.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c18271561.condition)
e1:SetTarget(c18271561.target)
e1:SetOperation(c18271561.operation)
c:RegisterEffect(e1)
end
function c18271561.filter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
end
function c18271561.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c18271561.filter,1,nil,tp)
end
function c18271561.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local dg=g:GetMinGroup(Card.GetAttack)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function c18271561.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local dg=g:GetMinGroup(Card.GetAttack)
if dg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
dg=dg:Select(tp,1,1,nil)
end
local atk=math.floor(dg:GetFirst():GetAttack()/2)
if Duel.Destroy(dg,REASON_EFFECT)>0 then
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
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

搜索帮助

0d507c66 1850385 C8b1a773 1850385