Commit 0d109d03 authored by TanakaKotoha's avatar TanakaKotoha

fix lua

parent 0d6e1589
......@@ -3,11 +3,12 @@ function c26807015.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
c:EnableReviveLimit()
--battle
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_BATTLED)
e0:SetOperation(c26807015.baop)
e0:SetCondition(c26807015.xyzcon)
e0:SetOperation(c26807015.xyzop)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
......@@ -41,32 +42,19 @@ function c26807015.initial_effect(c)
e3:SetTarget(c26807015.rsptg)
c:RegisterEffect(e3)
end
function c26807015.baop(e,tp,eg,ep,ev,re,r,rp)
function c26807015.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=c:GetBattleTarget()
if d and c:IsFaceup() and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and d:IsStatus(STATUS_BATTLE_DESTROYED) and not d:IsType(TYPE_TOKEN) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c26807015.reptg)
e1:SetOperation(c26807015.repop)
e1:SetLabelObject(c)
e1:SetReset(RESET_EVENT+0x1fe0000)
d:RegisterEffect(e1)
end
end
function c26807015.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_BATTLE) and not c:IsImmuneToEffect(e) end
return true
local tc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
e:SetLabelObject(tc)
return tc and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE) and not tc:IsType(TYPE_TOKEN)
end
function c26807015.repop(e,tp,eg,ep,ev,re,r,rp)
function c26807015.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(e:GetLabelObject(),Group.FromCards(c))
local tc=e:GetLabelObject()
if c:IsFaceup() and c:IsType(TYPE_XYZ) then
Duel.Overlay(c,tc)
end
end
function c26807015.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
......
......@@ -22,35 +22,23 @@ function c81009011.initial_effect(c)
e4:SetDescription(aux.Stringid(81009011,0))
e4:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLED)
e4:SetOperation(c81009011.baop)
e4:SetCondition(c81009011.xyzcon)
e4:SetOperation(c81009011.xyzop)
c:RegisterEffect(e4)
end
function c81009011.baop(e,tp,eg,ep,ev,re,r,rp)
function c81009011.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=c:GetBattleTarget()
if d and c:IsFaceup() and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and d:IsStatus(STATUS_BATTLE_DESTROYED) and not d:IsType(TYPE_TOKEN) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c81009011.reptg)
e1:SetOperation(c81009011.repop)
e1:SetLabelObject(c)
e1:SetReset(RESET_EVENT+0x1fe0000)
d:RegisterEffect(e1)
end
end
function c81009011.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_BATTLE) and not c:IsImmuneToEffect(e) end
return true
local tc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
e:SetLabelObject(tc)
return tc and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE) and not tc:IsType(TYPE_TOKEN)
end
function c81009011.repop(e,tp,eg,ep,ev,re,r,rp)
function c81009011.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(e:GetLabelObject(),Group.FromCards(c))
local tc=e:GetLabelObject()
if c:IsFaceup() and c:IsType(TYPE_XYZ) then
Duel.Overlay(c,tc)
end
end
function c81009011.efcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
......
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