Commit a795c645 authored by POLYMER's avatar POLYMER

fix

parent e1b4f765
......@@ -245,6 +245,7 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
te:GetHandler():RegisterFlagEffect(11451031,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local tp=te:GetHandlerPlayer()
local loc=te:GetHandler():GetLocation()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
......@@ -382,7 +383,7 @@ function cm.sptg(e,te,tp)
return te:GetHandler()==e:GetHandler()
end
function cm.sfilter(c,tp)
return c:IsFaceup() or c:IsControler(tp) or c:IsStatus(STATUS_CHAINING)
return c:IsFaceup() or c:IsControler(tp) or c:GetFlagEffect(11451031)>0
end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -273,6 +273,7 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
te:GetHandler():RegisterFlagEffect(11451031,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local tp=te:GetHandlerPlayer()
local loc=te:GetHandler():GetLocation()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
......@@ -411,7 +412,7 @@ function cm.sptg(e,c,tp)
return c==e:GetHandler()
end
function cm.sfilter(c,tp)
return c:IsFaceup() or c:IsControler(tp) or c:IsStatus(STATUS_CHAINING)
return c:IsFaceup() or c:IsControler(tp) or c:GetFlagEffect(11451031)>0
end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c)
local c=c or e:GetHandler()
......
......@@ -271,6 +271,7 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
te:GetHandler():RegisterFlagEffect(11451031,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local tp=te:GetHandlerPlayer()
local loc=te:GetHandler():GetLocation()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
......@@ -409,7 +410,7 @@ function cm.sptg(e,c,tp)
return c==e:GetHandler()
end
function cm.sfilter(c,tp)
return c:IsFaceup() or c:IsControler(tp) or c:IsStatus(STATUS_CHAINING)
return c:IsFaceup() or c:IsControler(tp) or c:GetFlagEffect(11451031)>0
end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c)
local c=c or e:GetHandler()
......
......@@ -240,6 +240,7 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
te:GetHandler():RegisterFlagEffect(11451031,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local tp=te:GetHandlerPlayer()
local loc=te:GetHandler():GetLocation()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
......@@ -378,7 +379,7 @@ function cm.sptg(e,c,tp)
return c==e:GetHandler()
end
function cm.sfilter(c,tp)
return c:IsFaceup() or c:IsControler(tp) or c:IsStatus(STATUS_CHAINING)
return c:IsFaceup() or c:IsControler(tp) or c:GetFlagEffect(11451031)>0
end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c)
local c=c or e:GetHandler()
......
......@@ -261,7 +261,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_NEGATE)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x1) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x1) return end
re:SetLabel(re:GetLabel()+0x1)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -276,7 +276,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_TOHAND)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x8) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x8) return end
re:SetLabel(re:GetLabel()+0x8)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -295,7 +295,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_REMOVE)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x40) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x40) return end
re:SetLabel(re:GetLabel()+0x40)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -262,7 +262,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_DAMAGE)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x200) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x200) return end
re:SetLabel(re:GetLabel()+0x200)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -293,7 +293,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_DRAW)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x1000) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x1000) return end
re:SetLabel(re:GetLabel()+0x1000)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -373,7 +373,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_HANDES)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x8000) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x8000) return end
re:SetLabel(re:GetLabel()+0x8000)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
--蒹葭苍苍
local cm, m, ofs = GetID()
local yr = 13020010
Duel.LoadScript("c16670000.lua")
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end)
function cm.initial_effect(c)
aux.AddCodeList(c, yr)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1, m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m, 2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(QY_mx)
e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.spcon2)
e3:SetCost(cm.spcost2)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
aux.AddCodeList(c, yr)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1, m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m, 2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(QY_mx)
e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.spcon2)
e3:SetCost(cm.spcost2)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
end
function cm.filter(c)
return aux.IsCodeListed(c, yr) and c:IsAbleToHand()
return aux.IsCodeListed(c, yr) and c:IsAbleToHand()
end
function cm.filter2(c, e, tp)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.IsExistingMatchingCard(cm.filter, tp, LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
if chk == 0 then return Duel.IsExistingMatchingCard(cm.filter, tp, LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function cm.activate(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1 - tp, g)
end
local c = e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1 - tp, g)
end
end
function cm.cfilter(c, tp)
return c:IsType(TYPE_NORMAL)
return c:IsType(TYPE_NORMAL)
end
function cm.spcon2(e, tp, eg, ep, ev, re, r, rp)
return eg:IsExists(cm.cfilter, 1, nil, tp)
return eg:IsExists(cm.cfilter, 1, nil, tp)
end
function cm.spcost2(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil) end
Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 1, nil) end
Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
end
function cm.sptg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsType(TYPE_SPELL + TYPE_EQUIP) end
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
if chk == 0 then return Duel.IsExistingTarget(cm.filter2, tp, LOCATION_GRAVE, 0, 1, nil, e, tp) and zzx > 0 end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectTarget(tp, cm.filter2, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
e:SetLabel(zz, sx, lv)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsType(TYPE_SPELL + TYPE_EQUIP) end
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
if chk == 0 then return Duel.IsExistingTarget(cm.filter2, tp, LOCATION_GRAVE, 0, 1, nil, e, tp) and zzx > 0 end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectTarget(tp, cm.filter2, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
e:SetLabel(zz, sx, lv)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
end
function cm.spop2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local tc = Duel.GetFirstTarget()
local zz, sx, lv = e:GetLabel()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.IsPlayerCanSpecialSummonMonster(tp, tc:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER, 0, 0, lv, zz, sx) then return end
tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3, true)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(cm.atkval)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
local c = e:GetHandler()
local tc = Duel.GetFirstTarget()
local zz, sx, lv = e:GetLabel()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.IsPlayerCanSpecialSummonMonster(tp, tc:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER, 0, 0, lv, zz, sx) then return end
it.AddMonsterate(tc, TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3, true)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(cm.atkval)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
function cm.atkval(e, c)
return Duel.GetMatchingGroupCount(cm.atkfilter, e:GetHandlerPlayer(), LOCATION_GRAVE + LOCATION_REMOVED, 0, nil) *
500
return Duel.GetMatchingGroupCount(cm.atkfilter, e:GetHandlerPlayer(), LOCATION_GRAVE + LOCATION_REMOVED, 0, nil) *
500
end
function cm.atkfilter(c)
return aux.IsCodeListed(c, yr) and c:IsType(TYPE_EQUIP)
return aux.IsCodeListed(c, yr) and c:IsType(TYPE_EQUIP)
end
......@@ -19,12 +19,12 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13000766, 1))
e3:SetDescription(aux.Stringid(m, 1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE + LOCATION_REMOVED)
e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop2)
......@@ -106,7 +106,7 @@ function cm.desop(e, tp, eg, ep, ev, re, r, rp)
end
function cm.cfilter(c, tp)
return c:IsPreviousControler(tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetReasonPlayer() == 1 - tp
end
......
--所谓伊人
local cm, m, ofs = GetID()
local yr = 13020010
Duel.LoadScript("c16670000.lua") --引用库
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c)
aux.AddCodeList(c, yr)
-- local e1 = xg.epp2(c, m, 1, nil, 3, QY_sp, cm.setcon2, cm.cost, cm.target, cm.operation, true) --使用库内函数进行便捷注册
......@@ -92,7 +92,7 @@ end
function cm.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:IsCanBeDisabledByEffect(e) then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local oc = LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK
if Duel.GetTurnPlayer() ~= e:GetHandlerPlayer() then
oc = QY_sk
......@@ -136,7 +136,7 @@ function cm.operation2(e, tp, eg, ep, ev, re, r, rp)
local tc = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp):GetFirst()
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
if tc and Duel.IsPlayerCanSpecialSummonMonster(tp, tc:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER, 0, 0, lv, zz, sx) then
tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
it.AddMonsterate(tc, TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
......
--在水一方
local cm, m, ofs = GetID()
local yr = 13020010
Duel.LoadScript("c16670000.lua") --引用库
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c)
aux.AddCodeList(c, yr)
--aux.AddEquipSpellEffect(c, true, true, Card.IsFaceup, nil)
......@@ -9,11 +9,10 @@ function cm.initial_effect(c)
local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
cm.operation, true)
e1:SetCountLimit(1, m)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(cm.efilter1)
c:RegisterEffect(e4)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_DISABLE)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
......@@ -27,12 +26,7 @@ function cm.initial_effect(c)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
function cm.efilter1(e, te)
local ec = e:GetHandler():GetEquipTarget()
local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
return te:GetOwnerPlayer() ~= e:GetHandlerPlayer() and (g ~= nil and g:IsContains(ec))
--return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
end
function cm.AddEquipSpellEffect(c, is_self, is_opponent, filter, eqlimit, pause, skip_target)
local value = (type(eqlimit) == "function") and eqlimit or 1
if pause == nil then pause = false end
......
--在水之泗
local cm, m, ofs = GetID()
local yr = 13020010
Duel.LoadScript("c16670000.lua") --引用库
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c)
aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c, true, true, Card.IsFaceup, nil)
local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
cm.operation, true)
e1:SetCountLimit(1, m)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.descon)
--e3:SetCost(cm.cost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(cm.atkcon)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
local c2 = e:GetHandler()
local ec = c2:GetEquipGroup()
if #ec == 0 then
e:SetLabel(0)
return
end
local ct = ec:Filter(cm.cfilter2, nil, tp)
local ot = #ct
e:SetLabel(ot)
end)
c:RegisterEffect(e4)
local e13 = Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e13:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e13:SetCode(EVENT_LEAVE_FIELD)
e13:SetCountLimit(1, m + 1)
e13:SetLabelObject(e4)
e13:SetCondition(cm.descon2)
e13:SetTarget(cm.sptg)
e13:SetOperation(cm.desop)
c:RegisterEffect(e13)
aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c, true, true, Card.IsFaceup, nil)
local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
cm.operation, true)
e1:SetCountLimit(1, m)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.descon)
--e3:SetCost(cm.cost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(cm.atkcon)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
local c2 = e:GetHandler()
local ec = c2:GetEquipGroup()
if #ec == 0 then
e:SetLabel(0)
return
end
local ct = ec:Filter(cm.cfilter2, nil, tp)
local ot = #ct
e:SetLabel(ot)
end)
c:RegisterEffect(e4)
local e13 = Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e13:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e13:SetCode(EVENT_LEAVE_FIELD)
e13:SetCountLimit(1, m + 1)
e13:SetLabelObject(e4)
e13:SetCondition(cm.descon2)
e13:SetTarget(cm.sptg)
e13:SetOperation(cm.desop)
c:RegisterEffect(e13)
end
function cm.filter(c)
return c:IsCode(yr) and c:IsAbleToHand()
return c:IsCode(yr) and c:IsAbleToHand()
end
function cm.atkcon(e)
return Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL and e:GetHandler():GetBattleTarget()
return Duel.GetCurrentPhase() == PHASE_DAMAGE_CAL and e:GetHandler():GetBattleTarget()
end
function cm.atkval(e, c)
local tc = e:GetHandler():GetBattleTarget()
local tc = e:GetHandler():GetBattleTarget()
return math.max(tc:GetAttack(), tc:GetDefense())
return math.max(tc:GetAttack(), tc:GetDefense())
end
function cm.filter1(c, ec, c2)
return c:GetEquipTarget() == ec and c == c2
return c:GetEquipTarget() == ec and c == c2
end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget()
--local dg = eg:Filter(cm.filter1, nil, tc, c)
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
--if chk == 0 then return #dg > 0 and tc and zzx > 0 end
if chk == 0 then return tc and zzx > 0 end
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
e:SetLabel(zz, sx, lv)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget()
--local dg = eg:Filter(cm.filter1, nil, tc, c)
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
--if chk == 0 then return #dg > 0 and tc and zzx > 0 end
if chk == 0 then return tc and zzx > 0 end
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
e:SetLabel(zz, sx, lv)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end
local zz, sx, lv = e:GetLabel()
if not Duel.IsPlayerCanSpecialSummonMonster(tp, c:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, 0, 0, lv, zz, sx) then return end
c:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(c, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3, true)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(function(e1, c1)
return Duel.GetMatchingGroupCount(cm.vfilter, tp, LOCATION_GRAVE + QY_cw, 0, nil) * 500
end)
c:RegisterEffect(e2, true)
Duel.SpecialSummonComplete()
if not tc:IsImmuneToEffect(e) then
Duel.Equip(tp, tc, c)
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
end
local c = e:GetHandler()
local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end
local zz, sx, lv = e:GetLabel()
if not Duel.IsPlayerCanSpecialSummonMonster(tp, c:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, 0, 0, lv, zz, sx) then return end
it.AddMonsterate(c, TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(c, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3, true)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(function(e1, c1)
return Duel.GetMatchingGroupCount(cm.vfilter, tp, LOCATION_GRAVE + QY_cw, 0, nil) * 500
end)
c:RegisterEffect(e2, true)
Duel.SpecialSummonComplete()
if not tc:IsImmuneToEffect(e) then
Duel.Equip(tp, tc, c)
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
end
end
function cm.vfilter(c)
return aux.IsCodeListed(c, yr) and c:IsType(TYPE_EQUIP)
return aux.IsCodeListed(c, yr) and c:IsType(TYPE_EQUIP)
end
function cm.eqlimit(e, c)
return e:GetOwner() == c
return e:GetOwner() == c
end
function cm.cfilter(c, tp, rp)
return c:IsType(TYPE_EQUIP)
return c:IsType(TYPE_EQUIP)
end
function cm.cfilter2(c, tp)
return c:GetOwner() == tp
return c:GetOwner() == tp
end
function cm.descon(e, tp, eg, ep, ev, re, r, rp)
return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
end
function cm.descon2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local ec = e:GetLabelObject():GetLabel()
return ec ~= 0
local c = e:GetHandler()
local ec = e:GetLabelObject():GetLabel()
return ec ~= 0
end
function cm.filter6(c, e, tp, id, g)
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c, id) ~= 0
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c, id) ~= 0
end
function cm.filter5(c, e, tp, tc)
local o = true
if tc ~= nil then
o = c:CheckEquipTarget(tc)
end
return c:IsType(TYPE_EQUIP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and o
local o = true
if tc ~= nil then
o = c:CheckEquipTarget(tc)
end
return c:IsType(TYPE_EQUIP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and o
end
function cm.filter4(c, c2, id)
return c:CheckEquipTarget(c2) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
return c:CheckEquipTarget(c2) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
end
function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if chk == 0 then return c:IsLocation(QY_cw) end
Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
local c = e:GetHandler()
if chk == 0 then return c:IsLocation(QY_cw) end
Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
end
function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
local g1 = Duel.GetMatchingGroup(cm.filter6, tp, QY_gs, QY_gs, nil, e, tp, m, g2)
-- local g3 = g2:Filter(aux.TRUE, nil)
if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g1 > 0 end
local c = e:GetHandler()
Duel.SelectTarget(tp, Card.IsFaceup, tp, QY_gs, QY_gs, 1, 1, nil)
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
local g1 = Duel.GetMatchingGroup(cm.filter6, tp, QY_gs, QY_gs, nil, e, tp, m, g2)
-- local g3 = g2:Filter(aux.TRUE, nil)
if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g1 > 0 end
local c = e:GetHandler()
Duel.SelectTarget(tp, Card.IsFaceup, tp, QY_gs, QY_gs, 1, 1, nil)
end
function cm.desop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local tc = Duel.GetFirstTarget()
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp, tc)
g2 = g2:Select(tp, 1, 1, nil):GetFirst()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp, g2, tc)
end
Duel.BreakEffect()
if c:IsLocation(QY_cw) and c:IsRelateToEffect(e) then
Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
end
local c = e:GetHandler()
local tc = Duel.GetFirstTarget()
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp, tc)
g2 = g2:Select(tp, 1, 1, nil):GetFirst()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp, g2, tc)
end
Duel.BreakEffect()
if c:IsLocation(QY_cw) and c:IsRelateToEffect(e) then
Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
end
end
--在水之湄
local cm, m, ofs = GetID()
local yr = 13020010
Duel.LoadScript("c16670000.lua") --引用库
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c)
aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c, true, true, Card.IsFaceup, nil)
local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
cm.operation, true)
e1:SetCountLimit(1, m)
local e3 = Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1, m + 1)
e3:SetCost(cm.cost1)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(cm.efilter1)
c:RegisterEffect(e4)
aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c, true, true, Card.IsFaceup, nil)
local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
cm.operation, true)
e1:SetCountLimit(1, m)
local e3 = Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1, m + 1)
e3:SetCost(cm.cost1)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(cm.efilter1)
c:RegisterEffect(e4)
end
function cm.efilter1(e, te)
local ec = e:GetHandler():GetEquipTarget()
local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
return te:GetOwnerPlayer() ~= e:GetHandlerPlayer() and not (g ~= nil and g:IsContains(ec))
--return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
local ec = e:GetHandler():GetEquipTarget()
local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
return te:GetOwnerPlayer() ~= e:GetHandlerPlayer() and not (g ~= nil and g:IsContains(ec))
--return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
end
function cm.cost1(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost, tp, LOCATION_HAND, 0, 1, nil) end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp, Card.IsAbleToDeckAsCost, tp, LOCATION_HAND, 0, 1, 1, nil)
Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_COST)
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost, tp, LOCATION_HAND, 0, 1, nil) end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp, Card.IsAbleToDeckAsCost, tp, LOCATION_HAND, 0, 1, 1, nil)
Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_COST)
end
function cm.filter(c)
return c:IsCode(yr) and c:IsAbleToHand()
return c:IsCode(yr) and c:IsAbleToHand()
end
function cm.filter1(c, ec, c2)
return c:GetEquipTarget() == ec and c == c2
return c:GetEquipTarget() == ec and c == c2
end
function cm.filter2(c, ec, c2)
return c:IsAbleToRemove() -- and c:IsType(TYPE_MONSTER)
return c:IsAbleToRemove() -- and c:IsType(TYPE_MONSTER)
end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget()
--local dg = eg:Filter(cm.filter1, nil, tc, c)
-- local g1 = Duel.GetMatchingGroup(cm.filter2, tp, QY_gs, QY_gs, nil)
-- if chk == 0 then return #dg > 0 and tc and #g1 > 0 and c:IsAbleToRemove() end
local g1 = Duel.GetMatchingGroup(cm.filter2, tp, LOCATION_ONFIELD + LOCATION_GRAVE, LOCATION_ONFIELD + LOCATION_GRAVE,
nil)
if chk == 0 then return tc and #g1 > 0 and c:IsAbleToRemove() end
Duel.SetOperationInfo(0, CATEGORY_REMOVE, c, 2, 0, 0)
local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget()
--local dg = eg:Filter(cm.filter1, nil, tc, c)
-- local g1 = Duel.GetMatchingGroup(cm.filter2, tp, QY_gs, QY_gs, nil)
-- if chk == 0 then return #dg > 0 and tc and #g1 > 0 and c:IsAbleToRemove() end
local g1 = Duel.GetMatchingGroup(cm.filter2, tp, LOCATION_ONFIELD + LOCATION_GRAVE, LOCATION_ONFIELD + LOCATION_GRAVE,
nil)
if chk == 0 then return tc and #g1 > 0 and c:IsAbleToRemove() end
Duel.SetOperationInfo(0, CATEGORY_REMOVE, c, 2, 0, 0)
end
function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end
local g = Group.CreateGroup()
--local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, QY_gs, QY_gs, 1, 1, nil):GetFirst()
local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, LOCATION_ONFIELD + LOCATION_GRAVE,
LOCATION_ONFIELD + LOCATION_GRAVE, 1, 1, nil):GetFirst()
g:AddCard(g1)
g:AddCard(c)
Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
-- if g1:IsLocation(QY_cw) then
if g1:IsLocation(QY_cw) and g1:IsType(TYPE_MONSTER) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetRange(LOCATION_REMOVED)
if Duel.GetCurrentPhase() <= PHASE_STANDBY then
e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else
e1:SetReset(RESET_PHASE + PHASE_STANDBY)
end
g1:RegisterEffect(e1, true)
end
if g1:IsLocation(QY_cw) and not g1:IsType(TYPE_MONSTER) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon2)
e1:SetOperation(cm.spop2)
e1:SetRange(LOCATION_REMOVED)
if Duel.GetCurrentPhase() <= PHASE_STANDBY then
e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else
e1:SetReset(RESET_PHASE + PHASE_STANDBY)
end
g1:RegisterEffect(e1, true)
end
local c = e:GetHandler()
local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end
local g = Group.CreateGroup()
--local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, QY_gs, QY_gs, 1, 1, nil):GetFirst()
local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, LOCATION_ONFIELD + LOCATION_GRAVE,
LOCATION_ONFIELD + LOCATION_GRAVE, 1, 1, nil):GetFirst()
g:AddCard(g1)
g:AddCard(c)
Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
-- if g1:IsLocation(QY_cw) then
if g1:IsLocation(QY_cw) and g1:IsType(TYPE_MONSTER) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetRange(LOCATION_REMOVED)
if Duel.GetCurrentPhase() <= PHASE_STANDBY then
e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else
e1:SetReset(RESET_PHASE + PHASE_STANDBY)
end
g1:RegisterEffect(e1, true)
end
if g1:IsLocation(QY_cw) and not g1:IsType(TYPE_MONSTER) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon2)
e1:SetOperation(cm.spop2)
e1:SetRange(LOCATION_REMOVED)
if Duel.GetCurrentPhase() <= PHASE_STANDBY then
e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else
e1:SetReset(RESET_PHASE + PHASE_STANDBY)
end
g1:RegisterEffect(e1, true)
end
end
function cm.spcon2(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnCount() ~= e:GetLabel() and tp == Duel.GetTurnPlayer()
return Duel.GetTurnCount() ~= e:GetLabel() and tp == Duel.GetTurnPlayer()
end
function cm.spop2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
Duel.SendtoHand(c, nil, REASON_EFFECT)
local c = e:GetHandler()
Duel.SendtoHand(c, nil, REASON_EFFECT)
end
function cm.spcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and
tp == Duel.GetTurnPlayer()
return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and
tp == Duel.GetTurnPlayer()
end
-- function cm.spcon(e, tp, eg, ep, ev, re, r, rp)
-- return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
-- return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
-- end
function cm.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
local c = e:GetHandler()
Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
end
function cm.cfilter(c, tp, rp)
return c:IsPreviousControler(tp)
and rp == 1 - tp and c:IsType(TYPE_EQUIP)
return c:IsPreviousControler(tp)
and rp == 1 - tp and c:IsType(TYPE_EQUIP)
end
function cm.descon(e, tp, eg, ep, ev, re, r, rp)
return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
end
function cm.filter6(c, e, tp, id, g)
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c) ~= 0
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c) ~= 0
end
function cm.filter5(c, e, tp, tc)
return c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and c:IsSSetable()
return c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and c:IsSSetable()
end
function cm.filter4(c, c2)
return c2:CheckEquipTarget(c) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
return c2:CheckEquipTarget(c) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
end
function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g2 > 0 end
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g2 > 0 end
end
function cm.con4_4(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetCurrentChain() == 0
return Duel.GetCurrentChain() == 0
end
function cm.op4_5(e, tp, eg, ep, ev, re, r, rp)
local tc = e:GetLabelObject()
if tc:GetFlagEffect(m) ~= 0 then return end
local e4_5_1 = tc:GetActivateEffect()
e4_5_1:SetProperty(nil)
e4_5_1:SetHintTiming(0)
e4_5_1:SetCondition(aux.TRUE)
e:Reset()
local tc = e:GetLabelObject()
if tc:GetFlagEffect(m) ~= 0 then return end
local e4_5_1 = tc:GetActivateEffect()
e4_5_1:SetProperty(nil)
e4_5_1:SetHintTiming(0)
e4_5_1:SetCondition(aux.TRUE)
e:Reset()
end
function cm.desop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local g2 = Duel.SelectMatchingCard(tp, cm.filter5, tp, QY_kz, 0, 1, 1, nil, e, tp):GetFirst()
if Duel.SSet(tp, g2, tp) ~= 0 then
if c:IsType(TYPE_TRAP + TYPE_QUICKPLAY) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
g2:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
g2:RegisterEffect(e2)
else
local tc = g2
local e4_4 = g2:GetActivateEffect()
if e4_4 ~= nil then
local oq = e4_4:GetCondition()
local ow = e4_4:GetProperty()
e4_4:SetProperty(e4_4:GetProperty(), EFFECT_FLAG2_COF)
e4_4:SetHintTiming(0, 0x1e0 + TIMING_CHAIN_END)
e4_4:SetCondition(function(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetCurrentChain() == 0 and (not oq or oq(e, tp, eg, ep, ev, re, r, rp))
end)
tc:RegisterFlagEffect(m, RESET_EVENT + 0x1fe0000, 0, 1)
local e4_5 = Effect.CreateEffect(c)
e4_5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e4_5:SetCode(EVENT_ADJUST)
e4_5:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
if tc:GetFlagEffect(m) ~= 0 then return end
-- local e4_5_1 = tc:GetActivateEffect()
if ow ~= nil then
e4_4:SetProperty(ow)
end
-- e4_4:SetHintTiming(table.unpack(ow))
if oq ~= nil then
e4_4:SetCondition(oq)
end
e:Reset()
end)
e4_5:SetLabelObject(g2)
Duel.RegisterEffect(e4_5, tp)
end
end
end
local c = e:GetHandler()
local g2 = Duel.SelectMatchingCard(tp, cm.filter5, tp, QY_kz, 0, 1, 1, nil, e, tp):GetFirst()
if Duel.SSet(tp, g2, tp) ~= 0 then
if c:IsType(TYPE_TRAP + TYPE_QUICKPLAY) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
g2:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
g2:RegisterEffect(e2)
else
local tc = g2
local e4_4 = g2:GetActivateEffect()
if e4_4 ~= nil then
local oq = e4_4:GetCondition()
local ow = e4_4:GetProperty()
e4_4:SetProperty(e4_4:GetProperty(), EFFECT_FLAG2_COF)
e4_4:SetHintTiming(0, 0x1e0 + TIMING_CHAIN_END)
e4_4:SetCondition(function(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetCurrentChain() == 0 and (not oq or oq(e, tp, eg, ep, ev, re, r, rp))
end)
tc:RegisterFlagEffect(m, RESET_EVENT + 0x1fe0000, 0, 1)
local e4_5 = Effect.CreateEffect(c)
e4_5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e4_5:SetCode(EVENT_ADJUST)
e4_5:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
if tc:GetFlagEffect(m) ~= 0 then return end
-- local e4_5_1 = tc:GetActivateEffect()
if ow ~= nil then
e4_4:SetProperty(ow)
end
-- e4_4:SetHintTiming(table.unpack(ow))
if oq ~= nil then
e4_4:SetCondition(oq)
end
e:Reset()
end)
e4_5:SetLabelObject(g2)
Duel.RegisterEffect(e4_5, tp)
end
end
end
end
......@@ -171,7 +171,7 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp)
if not c:IsRelateToEffect(e) then return end
local zz, sx, lv = e:GetLabel()
if not Duel.IsPlayerCanSpecialSummonMonster(tp, c:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, 0, 0, lv, zz, sx) then return end
c:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
it.AddMonsterate(c, TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(c, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
Duel.SpecialSummonComplete()
......
--OneInAMillion
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,13020032)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetCountLimit(1,id)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--back
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(0x30)
e3:SetCountLimit(1,id)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--白露未已
local cm, m, o = GetID()
local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end)
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1, m)
e2:SetCondition(cm.condition)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e11 = Effect.CreateEffect(c)
-- e11:SetDescription(aux.Stringid(m, 0))
e11:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
e11:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e11:SetProperty(EFFECT_FLAG_DELAY)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetCost(cm.cost)
e11:SetTarget(cm.drtg)
e11:SetOperation(cm.drop)
c:RegisterEffect(e11)
if not cm.global_check then
cm.global_check = true
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_ADJUST)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetOperation(cm.adop)
Duel.RegisterEffect(e4, tp)
end
end
function s.ckfi1ter(c)
return c:GetSequence()==0
function cm.cfilter(c, e, tp, sc)
return c:IsAbleToDeckAsCost() and aux.IsCodeListed(c, yr) and (c:IsLocation(QY_sk) or
Duel.GetLocationCountFromEx(tp, tp, c, sc) > 0)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0x01,0)>0 end
function cm.cfilter2(c, e, tp, sc)
return c:IsAbleToExtraAsCost() and Duel.GetLocationCountFromEx(tp, tp, c, sc) > 0
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.ckfi1ter,tp,0x01,0,nil)
if #g>0 then
local tc=g:GetFirst()
Duel.MoveSequence(tc,SEQ_DECKTOP)
Duel.ConfirmDecktop(tp,1)
local ThCheck=false
local LockCheck=true
if tc:IsType(TYPE_RITUAL) then
LockCheck=false
if tc:IsAbleToHand() and Duel.SendtoHand(tc,nil,0x40)>0 then
Duel.ConfirmCards(1-tp,tc)
ThCheck=true
end
end
if not ThCheck then
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
if LockCheck then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(s.aclimit)
e1:SetLabel(13020040)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.condition(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local g = Duel.GetMatchingGroup(cm.cfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, nil, e, tp, c)
local g2 = Duel.GetMatchingGroup(cm.cfilter2, tp, LOCATION_ONFIELD, 0, nil, e, tp, c)
return #g > 0 and #g2 > 0
end
function s.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SELECT)
local g1 = Duel.SelectMatchingCard(tp, cm.cfilter, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, 1, nil, e, tp, c)
local g2 = Duel.SelectMatchingCard(tp, cm.cfilter2, tp, LOCATION_ONFIELD, 0, 1, 1, g1, e, tp, c)
g2:Merge(g1)
c:SetMaterial(g2)
Duel.SendtoDeck(g2, tp, SEQ_DECKSHUFFLE, REASON_COST + REASON_MATERIAL)
end
function s.rlfil(c)
return c:IsReleasable() and c:GetOriginalType()&TYPE_MONSTER>0
function cm.cfilter3(c, e, tp, sc)
return (c:IsAbleToRemove() or c:IsAbleToGrave()) and aux.IsCodeListed(c, yr)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rlfil,tp,0x06,0,1,nil)
and e:GetHandler():IsAbleToHandAsCost() end
Duel.Hint(3,tp,500)
local g=Duel.SelectMatchingCard(tp,s.rlfil,tp,0x0e,0,1,1,e:GetHandler())
Duel.Release(g,REASON_COST)
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
local g = Duel.GetMatchingGroup(cm.cfilter3, tp, QY_kz, 0, nil)
if chk == 0 then return #g > 0 end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SELECT)
if #g == 0 then return end
local sg = g:Select(tp, 1, 1, nil):GetFirst()
local off = 1
local ops = {}
local opval = {}
if sg:IsAbleToRemove() then
ops[off] = aux.Stringid(m, 0)
opval[off - 1] = 1
off = off + 1
end
if sg:IsAbleToGrave() then
ops[off] = aux.Stringid(m, 1)
opval[off - 1] = 2
off = off + 1
end
local op = Duel.SelectOption(tp, table.unpack(ops))
if opval[op] == 1 then
Duel.SendtoGrave(sg, REASON_EFFECT)
elseif opval[op] == 2 then
Duel.Remove(sg, POS_FACEUP, REASON_EFFECT)
end
e:SetLabel(sg:GetCode())
end
function s.rlgck(g,sc,tp)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetLevel,sc:GetLevel())
and g:FilterCount(Card.IsLocation,nil,0x04)<=1
and Duel.GetMZoneCount(tp,g)>0
end
function s.rspfi1ter(c,e,tp)
local g=Duel.GetMatchingGroup(s.matfilter,c:GetControler(),0x36,0,c)
return c:IsType(TYPE_RITUAL) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and g:CheckSubGroup(s.rlgck,1,1,c,tp)
end
function s.matfilter(c)
return ((c:IsLocation(0x32) and c:IsAbleToDeck())
or (c:IsLocation(0x04) and c:IsReleasableByEffect()))
and c:IsType(TYPE_RITUAL) and c:IsLevelAbove(1)
function cm.cfilter4(c, code)
return c:IsAbleToHand() and aux.IsCodeListed(c, yr) and not c:IsCode(code)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rspfi1ter,tp,0x70,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x02)
function cm.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
local code = e:GetLabel()
local g = Duel.GetMatchingGroup(cm.cfilter4, tp, QY_kz + QY_md + QY_cw, 0, nil, code)
if chk == 0 then return #g > 0 end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, QY_kz + QY_md + QY_cw)
end
function cm.drop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local code = e:GetLabel()
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SELECT)
local g = Duel.GetMatchingGroup(cm.cfilter4, tp, QY_kz + QY_md + QY_cw, 0, nil, code)
local sg = g:Select(tp, 1, 1, nil)
Duel.SendtoHand(sg, tp, REASON_EFFECT)
if Duel.SelectYesNo(tp, aux.Stringid(m, 2)) then
local g = Duel.GetFieldGroup(tp, LOCATION_HAND, 0):Select(tp, 1, 1, nil)
if g:GetCount() > 0 then
Duel.BreakEffect()
if Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) ~= 0 then
Duel.RegisterFlagEffect(tp, m, RESET_PHASE + PHASE_END, 0, 2)
end
end
end
end
function cm.adop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local ng = Duel.GetMatchingGroup(cm.filsn, tp, LOCATION_HAND + LOCATION_ONFIELD + LOCATION_GRAVE + QY_kz, 0, nil)
local nc = ng:GetFirst()
while nc do
if not cm.reg then
cm.reg = Card.RegisterEffect
Card.RegisterEffect = cm.reg2
end
nc:RegisterFlagEffect(m, 0, 0, 1)
nc:ReplaceEffect(nc:GetOriginalCodeRule(), 0)
nc = ng:GetNext()
end
end
function cm.filsn(c)
return aux.IsCodeListed(c, yr) and c:GetFlagEffect(m) == 0
end
function cm.reg2(c, ie, ob)
local b = ob or false
local p = ie:GetCode()
local id, ida = ie:GetCountLimit()
if not aux.IsCodeListed(c, yr) or not ie:IsActivated() or (not id and not ida and
bit.band(ie:GetProperty(), EFFECT_FLAG_CARD_TARGET) == 0) then
return cm.reg(c, ie, b)
end
-- Debug.Message(id, ida)
local co = ie:GetCondition()
local ie2 = ie:Clone()
if id or ida then
ie2:SetCountLimit(id + 1, ida)
end
ie2:SetCondition(function(e, tp, eg, ep, ev, re, r, rp)
local code = Duel.GetFlagEffect(tp, m)
return (not co or co(e, tp, eg, ep, ev, re, r, rp)) and code > 0
end)
if bit.band(ie2:GetProperty(), EFFECT_FLAG_CARD_TARGET) ~= 0 then
local tn = ie:GetTarget()
ie2:SetProperty(ie2:GetProperty() - EFFECT_FLAG_CARD_TARGET)
ie2:SetTarget(function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local exis = Duel.IsExistingTarget
local exis2 = Duel.SelectTarget
local operat = Duel.SetOperationInfo
Duel.IsExistingTarget = function(fun, tp2, s1, o1, num, cg, ...)
-- cm[ie2] = { tp, fun, tp2, s1, o1, num, cg, ... }
return Duel.IsExistingMatchingCard(fun, tp2, s1, o1, num, cg, ...)
end
Duel.SelectTarget = function(tp1, fun, tp2, s1, o1, min, max, cg, ...)
local t = { ... }
for _, va in ipairs(t) do
if aux.GetValueType(va) == "Group" then
Group.KeepAlive(va)
end
end
cm[ie2] = { tp1, fun, tp2, s1, o1, min, max, cg, { ... } }
-- Duel.ConfirmCards(tp, table.unpack({ ... }))
return Group.CreateGroup()
end
Duel.SetOperationInfo = function(chainc, category, targets, count, target_player, target_param)
return operat(chainc, category, nil, count, target_player, target_param)
end
local jg = tn(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
Duel.IsExistingTarget = exis
Duel.SelectTarget = exis2
Duel.SetOperationInfo = operat
return jg
end)
local op = ie:GetOperation()
ie2:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
local ma = cm[ie2]
-- Debug.Message(ma[0])
-- Debug.Message(ma[1])
-- Debug.Message(ma[2])
-- Debug.Message(ma[3])
-- Debug.Message(ma[4])
-- Debug.Message(ma[5])
-- Debug.Message(ma[6])
-- Debug.Message(table.unpack(ma[8]))
-- Duel.ConfirmCards(tp, table.unpack(ma[9]))
local g = Duel.SelectMatchingCard(ma[1], ma[2], ma[3], ma[4], ma[5], ma[6], ma[7], ma[8],
table.unpack(ma[9]))
--ma[0], ma[1], ma[2], ma[3], ma[4], 1, ma[5],ma[6], table.unpack(ma[7])
-- local g = Group.CreateGroup()
local xta = Duel.GetFirstTarget
Duel.GetFirstTarget = function() return g:GetFirst(), g:GetNext(), g:GetNext(), g:GetNext() end
for tc in aux.Next(g) do
tc:CreateEffectRelation(e)
end
op(e, tp, eg, ep, ev, re, r, rp)
Duel.GetFirstTarget = xta
end)
end
ie:SetCondition(function(e, tp, eg, ep, ev, re, r, rp)
local code = Duel.GetFlagEffect(tp, m)
return (not co or co(e, tp, eg, ep, ev, re, r, rp)) and code == 0
end)
return cm.reg(c, ie, b), cm.reg(c, ie2, b)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(id,1)) then return end
::cancel::
local mg=Duel.GetMatchingGroup(s.matfilter,tp,0x36,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,s.rspfi1ter,tp,0x70,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
mg:RemoveCard(tc)
local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local mat=mg:SelectSubGroup(tp,s.rlgck,false,1,1,tc,tp)
if not mat then goto cancel end
tc:SetMaterial(mat)
local check=false
local matg=mat:Filter(Card.IsCode,nil,13020032)
if mat:FilterCount(Card.IsLocation,nil,0x0c)>0 then
check=true
elseif #matg>0 then
local ctc=matg:GetFirst()
if ctc:IsLocation(0x02) then Duel.ConfirmCards(1-tp,ctc) end
if ctc:IsLocation(0x10) then Duel.HintSelection(matg) end
check=true
end
local mg1=mat:Filter(Card.IsLocation,nil,0x32)
local mg2=mat:Filter(Card.IsLocation,nil,0x04)
if #mg1>0 then Duel.SendtoDeck(mg1,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) end
if #mg2>0 then Duel.Release(mg2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
if check then
local g=Duel.GetFieldGroup(tp,0x1c,0x1c):Filter(Card.IsAbleToHand,nil)
if #g>0 then
Duel.Hint(3,tp,505)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,0x40)
end
end
end
end
\ No newline at end of file
......@@ -51,7 +51,7 @@ function cm.disfilter(c)
return c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_ONFIELD,0,1,nil) end
if chk==0 then return Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -69,7 +69,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
if not re:GetHandler():IsStatus(STATUS_CHAINING) then return end
Duel.NegateActivation(ev)
end
end
......@@ -259,7 +258,7 @@ function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
--re:SetCategory(re:GetCategory()|CATEGORY_TODECK|CATEGORY_GRAVE_ACTION)
if re:GetLabel()&0x49421~=0 then re:SetLabel(re:GetLabel()+0x40000) return end
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x40000) return end
re:SetLabel(re:GetLabel()+0x40000)
local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,7 +28,7 @@ function c95101043.initial_effect(c)
e2:SetCountLimit(1,95101043+1)
e2:SetCondition(c95101043.setcon)
e2:SetCost(c95101043.setcost)
e2:SetTarget(c95101043.seteg)
e2:SetTarget(c95101043.settg)
e2:SetOperation(c95101043.setop)
c:RegisterEffect(e2)
end
......
......@@ -78,7 +78,7 @@ function c95101049.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=Duel.SelectMatchingCard(aux.NecroValleyFilter(Card.IsCanOverlay),tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if not tc:IsImmuneToEffect(e) then
......
......@@ -58,7 +58,7 @@ function c95101051.drop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c95101051.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp)
end
function c95101051.spfilter(c,e,tp)
return aux.IsCodeListed(c,95101001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -37,7 +37,7 @@ function c95101068.initial_effect(c)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetOperation(c95101068.damop)
e3:SetOperation(c95101068.ovop)
c:RegisterEffect(e3)
end
function c95101068.ovfilter(c)
......
......@@ -34,7 +34,7 @@ function cm.initial_effect(c)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--
--赋予神之进化
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_DELAY)
......@@ -59,7 +59,7 @@ function cm.tgfilter2(c)
return c:IsAbleToGrave() and c:IsRace(RACE_DIVINE) and c:IsReleasable()
end
function cm.srfilter(c)
return (aux.IsCodeListed(c,10000000) or aux.IsCodeListed(c,10000010) or aux.IsCodeListed(c,10000020) or c:IsCode(5253985,7373632,59094601,39913299,79339613,42469671,85758066,85182315,79868386,32247099,269012,10000000,10000010,10000020)) and c:IsAbleToHand()
return (aux.IsCodeListed(c,10000000) or aux.IsCodeListed(c,10000010) or aux.IsCodeListed(c,10000020) or c:IsCode(5253985,7373632,59094601,39913299,79339613,42469671,85758066,85182315,79868386,32247099,269012,10000000,10000010,10000020,79387392)) and c:IsAbleToHand()
end
function cm.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
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