Commit 1b01a6f5 authored by 未闻皂名's avatar 未闻皂名

2024/3/25 新增:不合理的虚孔

parent 1c3787b9
Pipeline #26043 passed with stages
in 8 minutes and 8 seconds
No preview for this file type
local m=120260021
local cm=_G["c"..m]
cm.name="不合理的虚孔"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
return Duel.GetAttacker():IsControler(1-tp)
and c and c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_CYBERSE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
--Cannot Attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Indes
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--Recover
local a=Duel.GetAttacker()
local b=Duel.GetAttackTarget()
if a and b and a:IsRelateToBattle() and b:IsRelateToBattle() and a:IsFaceup() and b:IsFaceup() then
local rec=math.abs(a:GetAttack()-b:GetAttack())*2
Duel.Recover(tp,rec,REASON_EFFECT)
end
end
\ No newline at end of file
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