Commit 70765704 authored by DailyShana's avatar DailyShana

update union

parent 681ba00d
......@@ -16,7 +16,7 @@ function c11678191.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c11678191.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c11678191.sptg)
e2:SetOperation(c11678191.spop)
c:RegisterEffect(e2)
......@@ -27,7 +27,7 @@ function c11678191.initial_effect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c11678191.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetTarget(c11678191.postg)
e3:SetOperation(c11678191.posop)
c:RegisterEffect(e3)
......@@ -36,7 +36,7 @@ function c11678191.initial_effect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c11678191.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c11678191.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -47,9 +47,7 @@ function c11678191.initial_effect(c)
e6:SetValue(c11678191.eqlimit)
c:RegisterEffect(e6)
end
function c11678191.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c11678191.old_union=true
function c11678191.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -77,7 +75,7 @@ function c11678191.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c11678191.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(11678191)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -12,7 +12,7 @@ function c12079734.initial_effect(c)
c:RegisterEffect(e1)
end
function c12079734.filter1(c,ec)
return c:IsType(TYPE_UNION) and c:CheckEquipTarget(ec)
return c:IsType(TYPE_UNION) and c:CheckEquipTarget(ec) and aux.CheckUnionEquip(c,ec)
end
function c12079734.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
......@@ -23,7 +23,7 @@ function c12079734.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c12079734.filter1(chkc,c)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c12079734.filter2(chkc) end
end
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:GetUnionCount()==0
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c12079734.filter1,tp,LOCATION_GRAVE,0,1,nil,c)
local b2=Duel.IsExistingTarget(c12079734.filter2,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 end
......@@ -51,10 +51,10 @@ function c12079734.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetLabel()==0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:GetUnionCount()==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c,false)
tc:SetStatus(STATUS_UNION,true)
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and aux.CheckUnionEquip(tc,c) and Duel.Equip(tp,tc,c,false) then
aux.SetUnionState(tc)
end
else
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
......
......@@ -16,7 +16,7 @@ function c12965761.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c12965761.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c12965761.sptg)
e2:SetOperation(c12965761.spop)
c:RegisterEffect(e2)
......@@ -36,7 +36,7 @@ function c12965761.initial_effect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e4:SetCondition(c12965761.uncon)
e4:SetCondition(aux.IsUnionState)
e4:SetValue(c12965761.repval)
c:RegisterEffect(e4)
--eqlimit
......@@ -47,9 +47,7 @@ function c12965761.initial_effect(c)
e5:SetValue(c12965761.eqlimit)
c:RegisterEffect(e5)
end
function c12965761.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c12965761.old_union=true
function c12965761.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -77,7 +75,7 @@ function c12965761.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c12965761.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(12965761)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -95,7 +93,7 @@ function c12965761.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c12965761.tkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c12965761.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -16,7 +16,7 @@ function c19086954.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c19086954.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c19086954.sptg)
e2:SetOperation(c19086954.spop)
c:RegisterEffect(e2)
......@@ -27,7 +27,7 @@ function c19086954.initial_effect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c19086954.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetTarget(c19086954.postg)
e3:SetOperation(c19086954.posop)
c:RegisterEffect(e3)
......@@ -36,7 +36,7 @@ function c19086954.initial_effect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c19086954.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c19086954.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -47,9 +47,7 @@ function c19086954.initial_effect(c)
e6:SetValue(c19086954.eqlimit)
c:RegisterEffect(e6)
end
function c19086954.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c19086954.old_union=true
function c19086954.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -77,7 +75,7 @@ function c19086954.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c19086954.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(19086954)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -50,7 +50,8 @@ function c23265594.eqlimit(e,c)
return c:IsRace(RACE_MACHINE) or e:GetHandler():GetEquipTarget()==c
end
function c23265594.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and ct2==0
end
function c23265594.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c23265594.filter(chkc) end
......@@ -70,7 +71,7 @@ function c23265594.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c23265594.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(23265594)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -14,10 +14,10 @@ function c26931058.filter1(c,tp)
and Duel.IsExistingTarget(c26931058.filter2,tp,LOCATION_MZONE,0,1,c,c)
end
function c26931058.filter2(c,ec)
return c:IsFaceup() and ec:CheckEquipTarget(c)
return c:IsFaceup() and ec:CheckEquipTarget(c) and aux.CheckUnionEquip(ec,c)
end
function c26931058.filter3(c,e,tp)
return c:IsFaceup() and c:IsStatus(STATUS_UNION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsHasEffect(EFFECT_UNION_STATUS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c26931058.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......@@ -51,8 +51,9 @@ function c26931058.efop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) and Duel.Equip(tp,tc1,tc2,false) then
tc1:SetStatus(STATUS_UNION,true)
if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e)
and aux.CheckUnionEquip(tc1,tc2) and Duel.Equip(tp,tc1,tc2,false) then
aux.SetUnionState(tc1)
end
else
local tc=Duel.GetFirstTarget()
......
......@@ -51,7 +51,8 @@ function c30012506.initial_effect(c)
c:RegisterEffect(e6)
end
function c30012506.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and ct2==0
end
function c30012506.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -72,7 +73,7 @@ function c30012506.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c30012506.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c31768112.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c31768112.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c31768112.sptg)
e2:SetOperation(c31768112.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c31768112.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c31768112.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--draw
......@@ -48,9 +48,7 @@ function c31768112.initial_effect(c)
e5:SetValue(c31768112.eqlimit)
c:RegisterEffect(e5)
end
function c31768112.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c31768112.old_union=true
function c31768112.eqlimit(e,c)
return c:IsRace(RACE_MACHINE)
end
......@@ -75,7 +73,7 @@ function c31768112.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c31768112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(31768112)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -92,7 +90,7 @@ function c31768112.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c31768112.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
return aux.IsUnionState(e) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
end
function c31768112.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -51,7 +51,8 @@ function c3405259.initial_effect(c)
c:RegisterEffect(e6)
end
function c3405259.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and ct2==0
end
function c3405259.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -72,7 +73,7 @@ function c3405259.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c3405259.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -51,7 +51,8 @@ function c39890958.initial_effect(c)
c:RegisterEffect(e6)
end
function c39890958.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and ct2==0
end
function c39890958.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -72,7 +73,7 @@ function c39890958.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c39890958.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c42940404.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c42940404.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c42940404.sptg)
e2:SetOperation(c42940404.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c42940404.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c42940404.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--eqlimit
......@@ -45,9 +45,7 @@ function c42940404.initial_effect(c)
e5:SetOperation(c42940404.sop)
c:RegisterEffect(e5)
end
function c42940404.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c42940404.old_union=true
function c42940404.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:GetUnionCount()==0
end
......@@ -69,7 +67,7 @@ function c42940404.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c42940404.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(42940404)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c47228077.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c47228077.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c47228077.sptg)
e2:SetOperation(c47228077.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c47228077.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c47228077.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--destroy
......@@ -48,9 +48,7 @@ function c47228077.initial_effect(c)
e5:SetValue(c47228077.eqlimit)
c:RegisterEffect(e5)
end
function c47228077.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c47228077.old_union=true
function c47228077.eqlimit(e,c)
return c:IsSetCard(0x30)
end
......@@ -75,7 +73,7 @@ function c47228077.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c47228077.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(47228077)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -92,7 +90,7 @@ function c47228077.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c47228077.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
return aux.IsUnionState(e) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
end
function c47228077.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
......
......@@ -16,7 +16,7 @@ function c47415292.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c47415292.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c47415292.sptg)
e2:SetOperation(c47415292.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c47415292.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(400)
e3:SetCondition(c47415292.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
......@@ -34,14 +34,14 @@ function c47415292.initial_effect(c)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_PIERCE)
e5:SetCondition(c47415292.uncon)
e5:SetCondition(aux.IsUnionState)
c:RegisterEffect(e5)
--destroy sub
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e6:SetCondition(c47415292.uncon)
e6:SetCondition(aux.IsUnionState)
e6:SetValue(c47415292.repval)
c:RegisterEffect(e6)
--eqlimit
......@@ -52,9 +52,7 @@ function c47415292.initial_effect(c)
e7:SetValue(c47415292.eqlimit)
c:RegisterEffect(e7)
end
function c47415292.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c47415292.old_union=true
function c47415292.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -82,7 +80,7 @@ function c47415292.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c47415292.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(47415292)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c47693640.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c47693640.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c47693640.sptg)
e2:SetOperation(c47693640.spop)
c:RegisterEffect(e2)
......@@ -25,14 +25,14 @@ function c47693640.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
e3:SetCondition(c47693640.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
--Def up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(500)
e4:SetCondition(c47693640.uncon)
e4:SetCondition(aux.IsUnionState)
c:RegisterEffect(e4)
--handes
local e5=Effect.CreateEffect(c)
......@@ -50,7 +50,7 @@ function c47693640.initial_effect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e6:SetCondition(c47693640.uncon)
e6:SetCondition(aux.IsUnionState)
e6:SetValue(c47693640.repval)
c:RegisterEffect(e6)
--eqlimit
......@@ -61,9 +61,7 @@ function c47693640.initial_effect(c)
e7:SetValue(c47693640.eqlimit)
c:RegisterEffect(e7)
end
function c47693640.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c47693640.old_union=true
function c47693640.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -91,7 +89,7 @@ function c47693640.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c47693640.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(47693640)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -109,7 +107,7 @@ function c47693640.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c47693640.hdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c47693640.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -16,7 +16,7 @@ function c48568432.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c48568432.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c48568432.sptg)
e2:SetOperation(c48568432.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c48568432.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c48568432.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--eqlimit
......@@ -48,9 +48,7 @@ function c48568432.initial_effect(c)
e5:SetOperation(c48568432.spop2)
c:RegisterEffect(e5)
end
function c48568432.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c48568432.old_union=true
function c48568432.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:GetUnionCount()==0
end
......@@ -72,7 +70,7 @@ function c48568432.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c48568432.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(48568432)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -89,7 +87,7 @@ function c48568432.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c48568432.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c48568432.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
......
......@@ -16,7 +16,7 @@ function c57062206.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c57062206.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c57062206.sptg)
e2:SetOperation(c57062206.spop)
c:RegisterEffect(e2)
......@@ -25,14 +25,14 @@ function c57062206.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(2500)
e3:SetCondition(c57062206.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
--destroy sub
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c57062206.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c57062206.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -43,9 +43,7 @@ function c57062206.initial_effect(c)
e6:SetValue(c57062206.eqlimit)
c:RegisterEffect(e6)
end
function c57062206.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c57062206.old_union=true
function c57062206.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -73,7 +71,7 @@ function c57062206.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c57062206.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(57062206)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c59364406.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c59364406.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c59364406.sptg)
e2:SetOperation(c59364406.spop)
c:RegisterEffect(e2)
......@@ -37,7 +37,7 @@ function c59364406.initial_effect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e4:SetCondition(c59364406.uncon)
e4:SetCondition(aux.IsUnionState)
e4:SetValue(c59364406.repval)
c:RegisterEffect(e4)
--eqlimit
......@@ -48,9 +48,7 @@ function c59364406.initial_effect(c)
e5:SetValue(c59364406.eqlimit)
c:RegisterEffect(e5)
end
function c59364406.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c59364406.old_union=true
function c59364406.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -78,7 +76,7 @@ function c59364406.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c59364406.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(59364406)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -96,7 +94,7 @@ function c59364406.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c59364406.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c59364406.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -16,7 +16,7 @@ function c63676256.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c63676256.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c63676256.sptg)
e2:SetOperation(c63676256.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c63676256.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c63676256.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--eqlimit
......@@ -39,7 +39,7 @@ function c63676256.initial_effect(c)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetCondition(c63676256.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(-500)
c:RegisterEffect(e5)
local e6=e5:Clone()
......@@ -57,9 +57,7 @@ function c63676256.initial_effect(c)
e7:SetOperation(c63676256.desop)
c:RegisterEffect(e7)
end
function c63676256.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c63676256.old_union=true
function c63676256.filter(c)
return c:IsFaceup() and c:GetUnionCount()==0
end
......@@ -81,7 +79,7 @@ function c63676256.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c63676256.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(63676256)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -98,7 +96,7 @@ function c63676256.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c63676256.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and eg:GetCount()==1 and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and eg:GetCount()==1 and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c63676256.dfilter(c,rac)
return c:IsFaceup() and c:IsRace(rac)
......
......@@ -53,7 +53,8 @@ function c64500000.eqlimit(e,c)
return c:IsCode(62651957,65622692) or e:GetHandler():GetEquipTarget()==c
end
function c64500000.filter(c)
return c:IsFaceup() and c:IsCode(62651957,65622692)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsCode(62651957,65622692) and ct2==0
end
function c64500000.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c64500000.filter(chkc) end
......@@ -73,7 +74,7 @@ function c64500000.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c64500000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(64500000)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -53,7 +53,8 @@ function c65622692.eqlimit(e,c)
return c:IsCode(62651957) or e:GetHandler():GetEquipTarget()==c
end
function c65622692.filter(c)
return c:IsFaceup() and c:IsCode(62651957)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsCode(62651957) and ct2==0
end
function c65622692.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c65622692.filter(chkc) end
......@@ -73,7 +74,7 @@ function c65622692.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c65622692.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(65622692)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c65685470.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c65685470.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c65685470.sptg)
e2:SetOperation(c65685470.spop)
c:RegisterEffect(e2)
......@@ -25,21 +25,21 @@ function c65685470.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
e3:SetCondition(c65685470.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
--Def up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(500)
e4:SetCondition(c65685470.uncon)
e4:SetCondition(aux.IsUnionState)
c:RegisterEffect(e4)
--destroy sub
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c65685470.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(1)
c:RegisterEffect(e5)
--draw
......@@ -62,9 +62,7 @@ function c65685470.initial_effect(c)
e7:SetValue(c65685470.eqlimit)
c:RegisterEffect(e7)
end
function c65685470.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c65685470.old_union=true
function c65685470.eqlimit(e,c)
return c:IsSetCard(0x3d)
end
......@@ -89,7 +87,7 @@ function c65685470.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c65685470.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(65685470)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -106,7 +104,7 @@ function c65685470.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c65685470.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
return aux.IsUnionState(e) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
end
function c65685470.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -44,7 +44,7 @@ function c66399653.tgfilter(c,e,tp,chk)
end
function c66399653.cfilter(c,ec)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsType(TYPE_UNION) and c:CheckEquipTarget(ec) and not c:IsCode(ec:GetCode())
and c:IsType(TYPE_UNION) and c:CheckEquipTarget(ec) and aux.CheckUnionEquip(c,ec) and not c:IsCode(ec:GetCode())
end
function c66399653.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c66399653.tgfilter(chkc,e,tp,true) end
......@@ -65,8 +65,8 @@ function c66399653.eqop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=Duel.SelectMatchingCard(tp,c66399653.cfilter,tp,LOCATION_DECK,0,1,1,nil,tc)
local ec=sg:GetFirst()
if ec and Duel.Equip(tp,ec,tc) then
ec:SetStatus(STATUS_UNION,true)
if ec and aux.CheckUnionEquip(ec,tc) and Duel.Equip(tp,ec,tc) then
aux.SetUnionState(ec)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
......
......@@ -16,7 +16,7 @@ function c67159705.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c67159705.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c67159705.sptg)
e2:SetOperation(c67159705.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c67159705.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c67159705.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--eqlimit
......@@ -43,14 +43,12 @@ function c67159705.initial_effect(c)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetCondition(c67159705.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetTarget(c67159705.destg)
e5:SetOperation(c67159705.desop)
c:RegisterEffect(e5)
end
function c67159705.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c67159705.old_union=true
function c67159705.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -78,7 +76,7 @@ function c67159705.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c67159705.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(67159705)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c69456283.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c69456283.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c69456283.sptg)
e2:SetOperation(c69456283.spop)
c:RegisterEffect(e2)
......@@ -25,20 +25,20 @@ function c69456283.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(3000)
e3:SetCondition(c69456283.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
--pierce
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_PIERCE)
e4:SetCondition(c69456283.uncon)
e4:SetCondition(aux.IsUnionState)
c:RegisterEffect(e4)
--destroy sub
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c69456283.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c69456283.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -49,9 +49,7 @@ function c69456283.initial_effect(c)
e6:SetValue(c69456283.eqlimit)
c:RegisterEffect(e6)
end
function c69456283.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c69456283.old_union=true
function c69456283.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -79,7 +77,7 @@ function c69456283.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c69456283.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(69456283)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c7369217.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c7369217.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c7369217.sptg)
e2:SetOperation(c7369217.spop)
c:RegisterEffect(e2)
......@@ -24,7 +24,7 @@ function c7369217.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetCondition(c7369217.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(c7369217.efilter)
c:RegisterEffect(e3)
--destroy sub
......@@ -32,7 +32,7 @@ function c7369217.initial_effect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c7369217.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c7369217.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -43,9 +43,7 @@ function c7369217.initial_effect(c)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c7369217.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c7369217.old_union=true
function c7369217.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -70,7 +68,7 @@ function c7369217.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c7369217.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(7369217)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -51,7 +51,8 @@ function c77411244.initial_effect(c)
c:RegisterEffect(e6)
end
function c77411244.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and ct2==0
end
function c77411244.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -72,7 +73,7 @@ function c77411244.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c77411244.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c78349103.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c78349103.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c78349103.sptg)
e2:SetOperation(c78349103.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c78349103.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c78349103.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--eqlimit
......@@ -47,9 +47,7 @@ function c78349103.initial_effect(c)
e5:SetOperation(c78349103.sop)
c:RegisterEffect(e5)
end
function c78349103.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c78349103.old_union=true
function c78349103.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:GetUnionCount()==0
end
......@@ -71,7 +69,7 @@ function c78349103.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c78349103.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(78349103)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -52,13 +52,17 @@ function c79538761.initial_effect(c)
e7:SetValue(1)
c:RegisterEffect(e7)
end
function c79538761.filter(c)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and ct2==0
end
function c79538761.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c79538761.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(79538761)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c) end
and Duel.IsExistingTarget(c79538761.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,c)
local g=Duel.SelectTarget(tp,c79538761.filter,tp,LOCATION_MZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
c:RegisterFlagEffect(79538761,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
......@@ -66,12 +70,12 @@ function c79538761.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then
if not tc:IsRelateToEffect(e) or not c79538761.filter(tc) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c79538761.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c84313685.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c84313685.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c84313685.sptg)
e2:SetOperation(c84313685.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c84313685.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c84313685.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
......@@ -48,9 +48,7 @@ function c84313685.initial_effect(c)
e5:SetValue(c84313685.eqlimit)
c:RegisterEffect(e5)
end
function c84313685.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c84313685.old_union=true
function c84313685.eqlimit(e,c)
return c:IsSetCard(0x30)
end
......@@ -75,7 +73,7 @@ function c84313685.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c84313685.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(84313685)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -92,7 +90,7 @@ function c84313685.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c84313685.gspcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
return aux.IsUnionState(e) and e:GetHandler():GetEquipTarget()==eg:GetFirst()
end
function c84313685.gfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x30) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -16,7 +16,7 @@ function c84814897.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c84814897.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c84814897.sptg)
e2:SetOperation(c84814897.spop)
c:RegisterEffect(e2)
......@@ -25,21 +25,21 @@ function c84814897.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(900)
e3:SetCondition(c84814897.uncon)
e3:SetCondition(aux.IsUnionState)
c:RegisterEffect(e3)
--Def up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(900)
e4:SetCondition(c84814897.uncon)
e4:SetCondition(aux.IsUnionState)
c:RegisterEffect(e4)
--direct_attack
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(84814897,2))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c84814897.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetCost(c84814897.atkcost)
e5:SetOperation(c84814897.atkop)
c:RegisterEffect(e5)
......@@ -48,7 +48,7 @@ function c84814897.initial_effect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e6:SetCondition(c84814897.uncon)
e6:SetCondition(aux.IsUnionState)
e6:SetValue(c84814897.repval)
c:RegisterEffect(e6)
--eqlimit
......@@ -59,9 +59,7 @@ function c84814897.initial_effect(c)
e7:SetValue(c84814897.eqlimit)
c:RegisterEffect(e7)
end
function c84814897.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c84814897.old_union=true
function c84814897.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -89,7 +87,7 @@ function c84814897.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c84814897.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(84814897)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c85359414.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c85359414.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c85359414.sptg)
e2:SetOperation(c85359414.spop)
c:RegisterEffect(e2)
......@@ -37,7 +37,7 @@ function c85359414.initial_effect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e4:SetCondition(c85359414.uncon)
e4:SetCondition(aux.IsUnionState)
e4:SetValue(c85359414.repval)
c:RegisterEffect(e4)
--eqlimit
......@@ -48,9 +48,7 @@ function c85359414.initial_effect(c)
e5:SetValue(c85359414.eqlimit)
c:RegisterEffect(e5)
end
function c85359414.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c85359414.old_union=true
function c85359414.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -78,7 +76,7 @@ function c85359414.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c85359414.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(85359414)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -96,7 +94,7 @@ function c85359414.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c85359414.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_UNION) and ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return aux.IsUnionState(e) and ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c85359414.desfilter(c)
return c:IsFacedown()
......
......@@ -16,7 +16,7 @@ function c87564935.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c87564935.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c87564935.sptg)
e2:SetOperation(c87564935.spop)
c:RegisterEffect(e2)
......@@ -24,13 +24,13 @@ function c87564935.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetCondition(c87564935.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(c87564935.efilter1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetCondition(c87564935.uncon)
e4:SetCondition(aux.IsUnionState)
e4:SetValue(c87564935.efilter2)
c:RegisterEffect(e4)
--destroy sub
......@@ -38,7 +38,7 @@ function c87564935.initial_effect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e5:SetCondition(c87564935.uncon)
e5:SetCondition(aux.IsUnionState)
e5:SetValue(c87564935.repval)
c:RegisterEffect(e5)
--eqlimit
......@@ -49,9 +49,7 @@ function c87564935.initial_effect(c)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c87564935.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c87564935.old_union=true
function c87564935.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -76,7 +74,7 @@ function c87564935.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c87564935.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(87564935)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -16,7 +16,7 @@ function c87798440.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c87798440.uncon)
e2:SetCondition(aux.IsUnionState)
e2:SetTarget(c87798440.sptg)
e2:SetOperation(c87798440.spop)
c:RegisterEffect(e2)
......@@ -25,7 +25,7 @@ function c87798440.initial_effect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetCondition(c87798440.uncon)
e3:SetCondition(aux.IsUnionState)
e3:SetValue(c87798440.repval)
c:RegisterEffect(e3)
--destroy
......@@ -48,9 +48,7 @@ function c87798440.initial_effect(c)
e5:SetValue(c87798440.eqlimit)
c:RegisterEffect(e5)
end
function c87798440.uncon(e)
return e:GetHandler():IsStatus(STATUS_UNION)
end
c87798440.old_union=true
function c87798440.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -78,7 +76,7 @@ function c87798440.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c87798440.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(87798440)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -95,7 +93,7 @@ function c87798440.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c87798440.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetEquipTarget()==eg:GetFirst() and c87798440.uncon(e)
return ep~=tp and e:GetHandler():GetEquipTarget()==eg:GetFirst() and aux.IsUnionState(e)
end
function c87798440.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......
......@@ -19,7 +19,7 @@ function c8964854.filter(c,e,tp)
end
function c8964854.eqfilter(c,e,tp,ec)
local op=c:GetOwner()
return c:IsStatus(STATUS_UNION) and c:GetEquipTarget()==ec
return c:IsHasEffect(EFFECT_UNION_STATUS) and c:GetEquipTarget()==ec
and Duel.GetLocationCount(op,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,op)
end
function c8964854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -14,7 +14,7 @@ function c91597389.filter(c,tp)
return c:IsType(TYPE_UNION) and Duel.IsExistingMatchingCard(c91597389.filter2,tp,LOCATION_MZONE,0,1,nil,c)
end
function c91597389.filter2(c,eqc)
return c:IsFaceup() and c:GetUnionCount()==0 and eqc:CheckEquipTarget(c)
return c:IsFaceup() and eqc:CheckEquipTarget(c) and aux.CheckUnionEquip(eqc,c)
end
function c91597389.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c91597389.filter(chkc,tp) end
......@@ -30,9 +30,9 @@ function c91597389.operation(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c91597389.filter2,tp,LOCATION_MZONE,0,1,1,nil,tc)
if g:GetCount()>0 then
Duel.Equip(tp,tc,g:GetFirst())
tc:SetStatus(STATUS_UNION,true)
local tc2=g:GetFirst()
if tc2 and aux.CheckUnionEquip(tc,tc2) and Duel.Equip(tp,tc,tc2) then
aux.SetUnionState(tc)
end
end
end
......@@ -53,7 +53,8 @@ function c96300057.eqlimit(e,c)
return c:IsCode(51638941) or e:GetHandler():GetEquipTarget()==c
end
function c96300057.filter(c)
return c:IsFaceup() and c:IsCode(51638941)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and c:IsCode(51638941) and ct2==0
end
function c96300057.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c96300057.filter(chkc) end
......@@ -73,7 +74,7 @@ function c96300057.eqop(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
c:SetStatus(STATUS_UNION,true)
aux.SetUnionState(c)
end
function c96300057.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(96300057)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -147,7 +147,7 @@ STATUS_CHAINING =0x10000 --正在連鎖串中
STATUS_SUMMON_DISABLED =0x20000 --召唤无效後尚未移動
STATUS_ACTIVATE_DISABLED =0x40000 --发动无效後尚未移動
STATUS_EFFECT_REPLACED =0x80000 --效果被替代(红莲霸权)
STATUS_UNION =0x100000 --同盟
STATUS_UNION =0x100000 --N/A
STATUS_ATTACK_CANCELED =0x200000 --若其為攻擊者,則攻擊中止
STATUS_INITIALIZING =0x400000 --初始化..
STATUS_ACTIVATED =0x800000 --魔法陷阱卡发动過
......@@ -490,6 +490,8 @@ EFFECT_ONLY_ATTACK_MONSTER =343 --只能攻擊X
EFFECT_MUST_ATTACK_MONSTER =344 --若攻擊則必須攻擊X
EFFECT_PATRICIAN_OF_DARKNESS =345 --由對手選擇攻擊對象(黑暗貴族)
EFFECT_EXTRA_ATTACK_MONSTER =346 --對怪獸攻擊X次
EFFECT_UNION_STATUS =347 --同盟状态
EFFECT_OLDUNION_STATUS =348 --旧同盟状态
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --游戏开始时
......
......@@ -138,6 +138,28 @@ function Auxiliary.SpiritReturnOperation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function Auxiliary.IsUnionState(effect)
local c=effect:GetHandler()
return c:IsHasEffect(EFFECT_UNION_STATUS)
end
function Auxiliary.SetUnionState(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNION_STATUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
if c.old_union then
local e2=e1:Clone()
e2:SetCode(EFFECT_OLDUNION_STATUS)
c:RegisterEffect(e2)
end
end
function Auxiliary.CheckUnionEquip(uc,tc)
ct1,ct2=tc:GetUnionCount()
if uc.old_union then return ct1==0
else return ct2==0 end
end
function Auxiliary.TargetEqualFunction(f,value,a,b,c)
return function(effect,target)
return f(target,a,b,c)==value
......
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