Commit 78e3a2d8 authored by VanillaSalt's avatar VanillaSalt

Merge pull request #945 from Lsty/patch-56

Create c8763963.lua
parents 8d8229fa 8ae8f620
--魔王超龍 ベエルゼウス
function c8763963.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(nil),2)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--cannot attack announce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c8763963.antarget)
c:RegisterEffect(e3)
--atk 0
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_RECOVER)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c8763963.target)
e4:SetOperation(c8763963.operation)
c:RegisterEffect(e4)
end
function c8763963.antarget(e,c)
return c~=e:GetHandler()
end
function c8763963.filter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c8763963.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c8763963.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c8763963.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c8763963.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetBaseAttack())
end
function c8763963.dcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end
function c8763963.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
end
function c8763963.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:GetAttack()>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
tc:RegisterEffect(e1)
Duel.Recover(tp,tc:GetBaseAttack(),REASON_EFFECT)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetCondition(c8763963.dcon)
e2:SetOperation(c8763963.dop)
c:RegisterEffect(e2)
end
end
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