Commit 0d109d03 authored by TanakaKotoha's avatar TanakaKotoha

fix lua

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