Commit 5589f090 authored by POLYMER's avatar POLYMER

fix

parent 3fb41a03
--蒹葭苍苍 --蒹葭苍苍
local cm, m, ofs = GetID() local cm, m, ofs = GetID()
local yr = 13020010 local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end,function() dofile("script/c16670000.lua") end) xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end)
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
--Activate --Activate
local e1 = Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1, m) e1:SetCountLimit(1, m)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e3 = Effect.CreateEffect(c) local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m, 2)) e3:SetDescription(aux.Stringid(m, 2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(QY_mx) e3:SetRange(QY_mx)
e3:SetCountLimit(1, m + 1) e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.spcon2) e3:SetCondition(cm.spcon2)
e3:SetCost(cm.spcost2) e3:SetCost(cm.spcost2)
e3:SetTarget(cm.sptg2) e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2) e3:SetOperation(cm.spop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.filter(c) function cm.filter(c)
return aux.IsCodeListed(c, yr) and c:IsAbleToHand() return aux.IsCodeListed(c, yr) and c:IsAbleToHand()
end end
function cm.filter2(c,e,tp)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) function cm.filter2(c, e, tp)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false)
end end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk) 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 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) Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end end
function cm.activate(e, tp, eg, ep, ev, re, r, rp) function cm.activate(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK, 0, 1, 1, nil) local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT) Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1 - tp, g) Duel.ConfirmCards(1 - tp, g)
end end
end end
function cm.cfilter(c, tp) function cm.cfilter(c, tp)
return c:IsType(TYPE_NORMAL) return c:IsType(TYPE_NORMAL)
end end
function cm.spcon2(e, tp, eg, ep, ev, re, r, rp) 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 end
function cm.spcost2(e, tp, eg, ep, ev, re, r, rp, chk) 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 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) Duel.DiscardHand(tp, Card.IsDiscardable, 1, 1, REASON_COST + REASON_DISCARD)
end end
function cm.sptg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc) 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 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() 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 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) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectTarget(tp, cm.filter2, tp, LOCATION_GRAVE, 0, 1, 1, nil,e,tp) 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) local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
e:SetLabel(zz,sx,lv) e:SetLabel(zz, sx, lv)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
end end
function cm.spop2(e, tp, eg, ep, ev, re, r, rp) function cm.spop2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
local tc=Duel.GetFirstTarget() local tc = Duel.GetFirstTarget()
local zz,sx,lv=e:GetLabel() local zz, sx, lv = e:GetLabel()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then 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 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) tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP_DEFENSE) Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3=Effect.CreateEffect(c) local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT) e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED) e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true) tc:RegisterEffect(e3, true)
local e2=Effect.CreateEffect(c) Duel.SpecialSummonComplete()
e2:SetType(EFFECT_TYPE_SINGLE) end
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
end end
function cm.atkfilter(c)
return aux.IsCodeListed(c, yr) and c:IsType(TYPE_EQUIP)
end
...@@ -4,111 +4,117 @@ local yr = 13020010 ...@@ -4,111 +4,117 @@ local yr = 13020010
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
c:SetSPSummonOnce(m) c:SetSPSummonOnce(m)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,cm.filter66,aux.FilterBoolFunction(Card.IsType,TYPE_EFFECT),true) aux.AddFusionProcCodeFunRep(c, 13020000, aux.FilterBoolFunction(Card.IsType, TYPE_EFFECT), 1, 127, true, true)
local e1=cm.AddContactFusionProcedure(c,cm.ffilter,LOCATION_ONFIELD+LOCATION_HAND,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL):SetValue(SUMMON_VALUE_SELF) local e1 = aux.AddContactFusionProcedure(c, cm.ffilter, LOCATION_ONFIELD + LOCATION_HAND, 0, Duel.Remove, POS_FACEUP,
REASON_COST + REASON_MATERIAL):SetValue(SUMMON_VALUE_SELF)
local e2=Effect.CreateEffect(c) local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetOperation(cm.desop) e2:SetOperation(cm.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13000766,1)) e3:SetDescription(aux.Stringid(13000766, 1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED) e3:SetRange(LOCATION_GRAVE + LOCATION_REMOVED)
e3:SetCondition(cm.descon) e3:SetCondition(cm.descon)
e3:SetTarget(cm.sptg) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop2) e3:SetOperation(cm.desop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.filter66(c)
return aux.IsCodeListed(c, yr) function cm.ffilter(c, fc, sub, mg, sg)
end return c:IsAbleToRemoveAsCost() and (c:GetOriginalType() & TYPE_UNION ~= 0 or c:GetOriginalType() & TYPE_EQUIP ~= 0)
function cm.ffilter(c,fc,sub,mg,sg)
return c:IsAbleToRemoveAsCost() and (c:GetOriginalType()&TYPE_UNION~=0 or c:GetOriginalType()&TYPE_EQUIP~=0)
end end
function cm.filter(c,c2)
function cm.filter(c, c2)
return c:IsType(TYPE_EQUIP) and not c:IsForbidden() and aux.IsCodeListed(c, yr) and c:CheckEquipTarget(c2) return c:IsType(TYPE_EQUIP) and not c:IsForbidden() and aux.IsCodeListed(c, yr) and c:CheckEquipTarget(c2)
end end
function cm.AddContactFusionProcedure(c,filter,self_location,opponent_location,mat_operation,...) function aux.AddContactFusionProcedure(c, filter, self_location, opponent_location, mat_operation, ...)
self_location=self_location or 0 self_location = self_location or 0
opponent_location=opponent_location or 0 opponent_location = opponent_location or 0
local operation_params={...} local operation_params = { ... }
local e2=Effect.CreateEffect(c) local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA) e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.ContactFusionCondition(filter,self_location,opponent_location)) e2:SetCondition(cm.ContactFusionCondition(filter, self_location, opponent_location))
e2:SetOperation(cm.ContactFusionOperation(filter,self_location,opponent_location,mat_operation,operation_params)) e2:SetOperation(cm.ContactFusionOperation(filter, self_location, opponent_location, mat_operation, operation_params))
c:RegisterEffect(e2) c:RegisterEffect(e2)
return e2 return e2
end end
function cm.ContactFusionMaterialFilter(c,fc,filter)
return c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL) and (not filter or filter(c,fc)) function cm.ContactFusionMaterialFilter(c, fc, filter)
return c:IsCanBeFusionMaterial(fc, SUMMON_TYPE_SPECIAL) and (not filter or filter(c, fc))
end end
function cm.ContactFusionCondition(filter,self_location,opponent_location)
return function(e,c) function cm.ContactFusionCondition(filter, self_location, opponent_location)
if c==nil then return true end return function(e, c)
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c == nil then return true end
local tp=c:GetControler() if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local mg=Duel.GetMatchingGroup(cm.ContactFusionMaterialFilter,tp,self_location,opponent_location,c,c,filter) local tp = c:GetControler()
return #mg>=2 local mg = Duel.GetMatchingGroup(cm.ContactFusionMaterialFilter, tp, self_location, opponent_location, c, c,
end filter)
return #mg >= 2
end
end end
function cm.ContactFusionOperation(filter,self_location,opponent_location,mat_operation,operation_params)
return function(e,tp,eg,ep,ev,re,r,rp,c) function cm.ContactFusionOperation(filter, self_location, opponent_location, mat_operation, operation_params)
local mg=Duel.GetMatchingGroup(cm.ContactFusionMaterialFilter,tp,self_location,opponent_location,c,c,filter) return function(e, tp, eg, ep, ev, re, r, rp, c)
local g=mg:Select(tp, 2, 2, nil) local mg = Duel.GetMatchingGroup(cm.ContactFusionMaterialFilter, tp, self_location, opponent_location, c, c,
c:SetMaterial(g) filter)
mat_operation(g,table.unpack(operation_params)) local g = mg:Select(tp, 2, 2, nil)
end c:SetMaterial(g)
mat_operation(g, table.unpack(operation_params))
end
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
function cm.desop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,c) local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_GRAVE + LOCATION_DECK, 0, 1, 1, nil, c)
if g:GetCount()>0 then if g:GetCount() > 0 then
g=g:GetFirst() g = g:GetFirst()
local mg=Group.CreateGroup() local mg = Group.CreateGroup()
mg:AddCard(c) mg:AddCard(c)
local g2=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil) local g2 = Duel.GetMatchingGroup(cm.TRUE, tp, 0, LOCATION_MZONE, nil)
mg:Merge(g2) mg:Merge(g2)
local tc=c local tc = c
if g:IsLocation(LOCATION_GRAVE) and #mg>1 then if g:IsLocation(LOCATION_GRAVE) and #mg > 1 then
tc=mg:Select(tp, 1, 1, nil):GetFirst() tc = mg:Select(tp, 1, 1, nil):GetFirst()
Duel.Equip(tp,g,tc,true)
else
Duel.Equip(tp,g,tc,true)
end end
Duel.Equip(tp, g, tc, true, true)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Remove(c, POS_FACEUP,REASON_EFFECT) Duel.Remove(c, POS_FACEUP, REASON_EFFECT)
end end
end end
function cm.cfilter(c,tp) function cm.cfilter(c, tp)
return c:IsPreviousControler(tp) return c:IsPreviousControler(tp)
and c:GetReasonPlayer()==1-tp and c:GetReasonPlayer() == 1 - tp
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler()) function cm.descon(e, tp, eg, ep, ev, re, r, rp)
return eg:IsExists(cm.cfilter, 1, nil, tp) and not eg:IsContains(e:GetHandler())
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
local c=e:GetHandler() if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) local c = e:GetHandler()
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
function cm.desop2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
end end
function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--所谓伊人 --所谓伊人
local cm, m, ofs = GetID() local cm, m, ofs = GetID()
local yr = 13020010 local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end,function() dofile("script/c16670000.lua") end)--引用库 xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
local e0=Effect.CreateEffect(c) local e1 = xg.epp2(c, m, 1, nil, 3, QY_sp, cm.setcon2, cm.cost, cm.target, cm.operation, true) --使用库内函数进行便捷注册
e0:SetCategory(CATEGORY_EQUIP) local e2 = e1:Clone()
e0:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e0:SetRange(LOCATION_HAND) e2:SetCode(EVENT_FREE_CHAIN)
e0:SetCode(EVENT_FREE_CHAIN) e2:SetLabel(m)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(cm.setcon)
e0:SetCost(cm.cost) c:RegisterEffect(e2)
e0:SetCondition(cm.setcon) local e3 = xg.epp2(c, m, 4, EVENT_EQUIP, nil, QY_md + QY_cw, cm.setcon3, nil, nil, cm.operation2, true)
e0:SetTarget(cm.target) e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
e0:SetOperation(cm.operation) if cm.gl == nil then
c:RegisterEffect(e0) cm.gl = true
local e3=xg.epp2(c,m,4,EVENT_EQUIP,nil,QY_md+QY_cw,cm.setcon3,nil,nil,cm.operation2,true) cm[0] = 6
e3:SetCountLimit(1,m+EFFECT_COUNT_CODE_CHAIN) cm[1] = 0
if cm.gl==nil then
cm.gl=true
cm[0]=0
cm[1]=0
end end
end end
function cm.ffilter(c,c2) function cm.ffilter(c, c2)
return c:CheckEquipTarget(c2) return c:CheckEquipTarget(c2) and c2:IsFaceup()
end end
function cm.filter(c,e,g)
local g2=g:Filter(cm.ffilter, nil,c) function cm.filter(c, e, g)
return c:IsCanBeEffectTarget(e) and g2 and #g2>0 local g2 = g:Filter(cm.ffilter, nil, c)
return c:IsCanBeEffectTarget(e) and #g2 > 0
end end
function cm.filter2(c) function cm.filter2(c)
return c:IsType(TYPE_EQUIP) and not c:IsForbidden() and aux.IsCodeListed(c, yr) return c:IsType(TYPE_EQUIP) and not c:IsForbidden() and aux.IsCodeListed(c, yr)
end end
function cm.filter3(c,g)
function cm.filter3(c, g)
return g:IsContains(c) return g:IsContains(c)
end end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND,0,nil) function cm.setcon(e, tp, eg, ep, ev, re, r, rp)
local g2=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g) local g = Duel.GetMatchingGroup(cm.filter2, tp, LOCATION_HAND, 0, nil)
local g2 = Duel.GetMatchingGroup(cm.filter, tp, QY_gs, QY_gs, nil, e, g)
-- local g3=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,nil) -- local g3=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,nil)
-- local g4=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g3) -- local g4=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g3)
return g2 and #g2>0 or (Duel.GetTurnPlayer()==e:GetHandlerPlayer() and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)) return Duel.GetCurrentChain() ~= 0 and #g2 > 0 -- and #g4<=0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end function cm.setcon2(e, tp, eg, ep, ev, re, r, rp)
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD) -- local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND,0,nil)
-- local g2=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g)
-- local g3=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,nil)
-- local g4=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g3)
return Duel.GetCurrentChain() == 0 --#g4>0 and #g2<0
end
function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(), REASON_DISCARD)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local oc=LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK local c = e:GetHandler()
if Duel.GetTurnPlayer()~=e:GetHandlerPlayer() then local oc = LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK
oc=QY_sk if e:GetLabel() == m then
oc = QY_sk
end end
local g=Duel.GetMatchingGroup(cm.filter2,tp,oc,0,nil) local g = Duel.GetMatchingGroup(cm.filter2, tp, oc, 0, nil)
local g2=Duel.GetMatchingGroup(cm.filter,tp,QY_gs,QY_gs,nil,e,g) local g2 = Duel.GetMatchingGroup(cm.filter, tp, QY_gs, QY_gs, nil, e, g)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and g:IsContains(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and g:IsContains(chkc) end
if chk==0 then return g2 and #g2>0 end if chk == 0 then return #g2 > 0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_OPERATECARD)
Duel.SelectTarget(tp,cm.filter3,tp,QY_gs,QY_gs,1,1,nil,g2) Duel.SelectTarget(tp, cm.filter3, tp, QY_gs, QY_gs, 1, 1, nil, g2)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local tc=Duel.GetFirstTarget() 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) and tc:IsCanBeDisabledByEffect(e) then
local oc=LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK local oc = LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK
if Duel.GetTurnPlayer()~=e:GetHandlerPlayer() then if e:GetLabel() == m then
oc=QY_sk oc = QY_sk
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
local tcg=Duel.SelectMatchingCard(tp,cm.filter2,tp,oc,0,1,1,nil):GetFirst() local tcg = Duel.SelectMatchingCard(tp, Card.CheckEquipTarget, tp, oc, 0, 1, 1, nil, tc):GetFirst()
Duel.Equip(tp,tcg,tc,true) Duel.Equip(tp, tcg, tc, true)
end end
end end
function cm.filter5(c,e,tp)
return c:IsAbleToDeck() function cm.filter5(c, e, tp)
return c:IsType(TYPE_EQUIP) and c:IsAbleToDeck()
end end
function cm.filter6(c,e,tp)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) function cm.filter6(c, e, tp)
return c:IsType(TYPE_EQUIP) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false) and
Duel.IsPlayerCanSpecialSummonMonster(tp, c:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER)
end end
function cm.setcon3(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp, m)<=0 function cm.setcon3(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetFlagEffect(tp, m) <= 0
end end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
function cm.sumlimit(e, c, sump, sumtype, sumpos, targetp)
return c:IsType(TYPE_NORMAL) return c:IsType(TYPE_NORMAL)
end end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function cm.operation2(e, tp, eg, ep, ev, re, r, rp)
cm[tp]=cm[tp]+1 local c = e:GetHandler()
local num=cm[tp] cm[tp] = cm[tp] + 1
local g2 = Duel.GetMatchingGroup( cm.filter6, tp, LOCATION_GRAVE, 0, nil ,e,tp) local num = cm[tp]
local kx,zzx,sxx,zzjc,sxjc,zzl=it.sxbl() local g1 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE, 0, nil):GetFirst()
if Duel.Recover(tp,200,REASON_EFFECT)>0 then local g2 = Duel.GetMatchingGroup(cm.filter6, tp, LOCATION_GRAVE, 0, g1, e, tp)
if num>=6 and #g2>0 and zzx>0 and xg.ky(tp,m,1) then local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
if num >= 6 and g1 ~= nil and #g2 > 0 and zzx > 0 and xg.ky(tp, m, 1) then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_GRAVE, 0, 1, 3, nil) local g = Duel.SelectMatchingCard(tp, cm.filter5, tp, LOCATION_GRAVE, 0, 1, 1, nil)
Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local tc = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE, 0, 1, 1, nil ,e,tp):GetFirst() 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) 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 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) tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP_DEFENSE) Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
local e3=Effect.CreateEffect(c) local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT) e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED) e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true) 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:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(cm.atkval)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local e4=Effect.CreateEffect(c) local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION) e4:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0) e4:SetTargetRange(1, 0)
e4:SetTarget(cm.sumlimit) e4:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e4,true) Duel.RegisterEffect(e4, true)
end end
end end
if num>=10 and xg.ky(tp,m,2) then if num >= 10 and xg.ky(tp, m, 2) then
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c, nil, 2, REASON_EFFECT) Duel.SendtoDeck(c, nil, 2, REASON_EFFECT)
end end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp, cm.filter5, tp, LOCATION_GRAVE+QY_cs+QY_cw, LOCATION_GRAVE+QY_cs+QY_cw, 1, num, nil) local g = Duel.SelectMatchingCard(tp, cm.filter5, tp, LOCATION_GRAVE + QY_cs + QY_cw, LOCATION_GRAVE + QY_cs +
QY_cw, 1, num, nil)
Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
Duel.RegisterFlagEffect(tp, m, SD_js, 0, 1) Duel.RegisterFlagEffect(tp, m, SD_js, 0, 1)
end end
end end
end
function cm.atkval(e,c)
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)
end
\ No newline at end of file
--在水一方 --在水一方
local cm, m, ofs = GetID() local cm, m, ofs = GetID()
local yr = 13020010 local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end,function() dofile("script/c16670000.lua") end)--引用库 xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
--cm.AddEquipSpellEffect(c,true,true,nil,nil) aux.AddEquipSpellEffect(c, true, true, nil, nil)
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,
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) cm.operation, true)
e1:SetCountLimit(1,m) e1:SetCountLimit(1, m)
local e2=Effect.CreateEffect(c) local e3 = 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:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_REMOVED) e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m+1) e3:SetCountLimit(1, m + 1)
e3:SetCondition(cm.descon) e3:SetCondition(cm.descon)
e3:SetCost(cm.cost) e3:SetCost(cm.cost)
e3:SetTarget(cm.sptg) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--[[function cm.AddEquipSpellEffect(c,is_self,is_opponent,filter,eqlimit,pause,skip_target)
local value=(type(eqlimit)=="function") and eqlimit or 1 function aux.AddEquipSpellEffect(c, is_self, is_opponent, filter, eqlimit, pause, skip_target)
if pause==nil then pause=false end local value = (type(eqlimit) == "function") and eqlimit or 1
if skip_target==nil then skip_target=false end if pause == nil then pause = false end
if skip_target == nil then skip_target = false end
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
if not skip_target then if not skip_target then
e1:SetTarget(cm.EquipSpellTarget(is_self,is_opponent,filter,eqlimit)) e1:SetTarget(cm.EquipSpellTarget(is_self, is_opponent, filter, eqlimit))
end end
e1:SetOperation(cm.EquipSpellOperation(eqlimit)) e1:SetOperation(cm.EquipSpellOperation(eqlimit))
if not pause then if not pause then
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Equip limit --Equip limit
local e2=Effect.CreateEffect(c) local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
...@@ -51,97 +48,105 @@ end ...@@ -51,97 +48,105 @@ end
c:RegisterEffect(e2) c:RegisterEffect(e2)
return e1 return e1
end end
function cm.EquipSpellTarget(is_self,is_opponent,filter,eqlimit)
local loc1=is_self and LOCATION_MZONE or 0 function cm.EquipSpellTarget(is_self, is_opponent, filter, eqlimit)
local loc2=is_opponent and LOCATION_MZONE or 0 local loc1 = is_self and LOCATION_MZONE or 0
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local loc2 = is_opponent and LOCATION_MZONE or 0
if chkc then return chkc:IsLocation(LOCATION_MZONE) and (not eqlimit or eqlimit(e,chkc)) end return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
if chk==0 then return Duel.IsExistingTarget(filter,tp,loc1,loc2,1,nil) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and (not eqlimit or eqlimit(e, chkc)) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) if chk == 0 then return Duel.IsExistingTarget(filter, tp, loc1, loc2, 1, nil) end
Duel.SelectTarget(tp,filter,tp,loc1,loc2,1,1,nil) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SelectTarget(tp, filter, tp, loc1, loc2, 1, 1, nil)
Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
end end
end end
function cm.EquipSpellOperation(eqlimit) function cm.EquipSpellOperation(eqlimit)
return function (e,tp,eg,ep,ev,re,r,rp) return function(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler() local c = e:GetHandler()
local tc=Duel.GetFirstTarget() local tc = Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and (not eqlimit or eqlimit(e,tc)) then if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and (not eqlimit or eqlimit(e, tc)) then
Duel.Equip(tp,c,tc) Duel.Equip(tp, c, tc)
end end
end end
end]]-- end
function cm.filter(c) function cm.filter(c)
return c:IsCode(yr) and c:IsAbleToHand() return c:IsCode(yr) and c:IsAbleToHand()
end end
function cm.filter1(c,ec,c2)
return c:GetEquipTarget()==ec and c==c2 function cm.filter1(c, ec, c2)
return c:GetEquipTarget() == ec and c == c2
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local tc=e:GetHandler():GetEquipTarget() local c = e:GetHandler()
--local dg=eg:Filter(cm.filter1,nil,tc,c) local tc = e:GetHandler():GetEquipTarget()
local g = Duel.GetMatchingGroup(cm.filter, tp, LOCATION_DECK+QY_md, 0, nil) local dg = eg:Filter(cm.filter1, nil, tc, c)
if chk==0 then return tc and tc:IsCanChangePosition() and #g>0 end local g = Duel.GetMatchingGroup(cm.filter, tp, LOCATION_DECK + QY_md, 0, nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) if chk == 0 then return #dg > 0 and tc and tc:IsCanChangePosition() and #g > 0 end
Duel.SetOperationInfo(0, CATEGORY_POSITION, tc, 1, 0, 0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local tc=c:GetEquipTarget() local c = e:GetHandler()
local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if tc and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then if tc and Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK) ~= 0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK+QY_md, 0, 1, 1, nil) local g = Duel.SelectMatchingCard(tp, cm.filter, tp, LOCATION_DECK + QY_md, 0, 1, 1, nil)
if g:GetCount() > 0 then if g:GetCount() > 0 then
if Duel.SendtoHand(g, nil, REASON_EFFECT)~=0 then if Duel.SendtoHand(g, nil, REASON_EFFECT) ~= 0 then
Duel.ConfirmCards(1 - tp, g) Duel.ConfirmCards(1 - tp, g)
if xg.ky(tp,m,1) then if xg.ky(tp, m, 1) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
end end
end end
end end
end end
end end
function cm.cfilter(c,tp,rp) function cm.cfilter(c, tp, rp)
return c:IsPreviousControler(tp) return c:IsPreviousControler(tp)
and rp==1-tp and c:IsPreviousLocation(LOCATION_MZONE) and rp == 1 - tp and c:IsPreviousLocation(LOCATION_MZONE)
end 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()) 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())
end end
function cm.filter6(c,e,tp,id,g)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and #g:Filter(cm.filter4, nil,c)~=0 function cm.filter6(c, e, tp, id, g)
return c:IsCanBeSpecialSummoned(e, 0, tp, true, false) and #g:Filter(cm.filter4, nil, c) ~= 0
end end
function cm.filter5(c,e,tp)
return c:IsType(TYPE_EQUIP) or c:IsType(TYPE_UNION) function cm.filter5(c, e, tp)
return c:IsType(TYPE_EQUIP)
end end
function cm.filter4(c,c2)
return c:CheckEquipTarget(c2) and not c:IsCode(m) function cm.filter4(c, c2)
return c2:CheckEquipTarget(c) and not c:IsCode(m)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk==0 then return c:IsLocation(QY_cw) end local c = e:GetHandler()
Duel.SendtoGrave(c,REASON_EFFECT+REASON_RETURN) if chk == 0 then return c:IsLocation(QY_cw) end
Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g2 = Duel.GetMatchingGroup( cm.filter5, tp, LOCATION_GRAVE+QY_cw, 0, nil,e,tp) function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
local g1 = Duel.GetMatchingGroup( cm.filter6, tp, LOCATION_GRAVE+QY_cw, 0, nil,e,tp,m,g2) local g2 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE + QY_cw, 0, nil, e, tp)
local g1 = Duel.GetMatchingGroup(cm.filter6, tp, LOCATION_GRAVE + QY_cw, 0, nil, e, tp, m, g2)
-- local g3 = g2:Filter(aux.TRUE, nil) -- local g3 = g2:Filter(aux.TRUE, nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g1>0 end if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and #g1 > 0 end
local c=e:GetHandler() local c = e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g2 = Duel.GetMatchingGroup( cm.filter5, tp, LOCATION_GRAVE+QY_cw, 0, nil,e,tp)
local g1 = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE+QY_cw, 0, 1, 1, nil,e,tp,m,g2):GetFirst()
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
g2=g2:FilterSelect(tp,cm.filter4,1,1,nil,g1):GetFirst()
Duel.Equip(tp,g2,g1,true)
end end
function cm.desop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE + QY_cw, 0, nil, e, tp)
local g1 = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE + QY_cw, 0, 1, 1, nil, e, tp, m, g2):GetFirst()
Duel.SpecialSummon(g1, 0, tp, tp, false, false, POS_FACEUP)
g2 = g2:Filter(cm.filter4, nil, g1)
Duel.Equip(tp, g2, g1, true)
end
--在水之泗 --在水之泗
local cm, m, ofs = GetID() local cm, m, ofs = GetID()
local yr = 13020010 local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end,function() dofile("script/c16670000.lua") end)--引用库 xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c,true,true,Card.IsFaceup,nil) 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) local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
e1:SetCountLimit(1,m) cm.operation, true)
local e3=Effect.CreateEffect(c) e1:SetCountLimit(1, m)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) local e3 = Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_REMOVED) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,m+1) e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(cm.descon) e3:SetCountLimit(1, m + 1)
--e3:SetCost(cm.cost) e3:SetCondition(cm.descon)
e3:SetTarget(cm.sptg) --e3:SetCost(cm.cost)
e3:SetOperation(cm.desop) e3:SetTarget(cm.sptg)
c:RegisterEffect(e3) e3:SetOperation(cm.desop)
-- c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c) --
e2:SetType(EFFECT_TYPE_EQUIP) local e4 = Effect.CreateEffect(c)
e2:SetCode(EFFECT_UPDATE_ATTACK) e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCondition(cm.atkcon) e4:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetValue(cm.atkval) e4:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
c:RegisterEffect(e2) local c2 = e:GetHandler()
local e4=Effect.CreateEffect(c) local ec = c2:GetEquipGroup()
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) if #ec == 0 then
e4:SetCode(EVENT_LEAVE_FIELD_P) e:SetLabel(0)
e4:SetOperation(function (e,tp,eg,ep,ev,re,r,rp) return
local c2=e:GetHandler() end
local ec=c2:GetEquipGroup() local ct = ec:Filter(cm.cfilter2, nil, tp)
if #ec==0 then local ot = #ct
e:SetLabel(0) e:SetLabel(ot)
return end)
end c:RegisterEffect(e4)
local ct=ec:Filter(cm.cfilter2, nil,tp) local e13 = Effect.CreateEffect(c)
local ot=#ct e13:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e:SetLabel(ot) e13:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
end) e13:SetCode(EVENT_LEAVE_FIELD)
c:RegisterEffect(e4) e13:SetCountLimit(1, m + 1)
local e13=Effect.CreateEffect(c) e13:SetLabelObject(e4)
e13:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e13:SetCondition(cm.descon2)
e13:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e13:SetTarget(cm.sptg)
e13:SetCode(EVENT_LEAVE_FIELD) e13:SetOperation(cm.desop)
e13:SetCountLimit(1,m+1) c:RegisterEffect(e13)
e13:SetLabelObject(e4)
e13:SetCondition(cm.descon2)
e13:SetTarget(cm.sptg)
e13:SetOperation(cm.desop)
c:RegisterEffect(e13)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(yr) and c:IsAbleToHand() return c:IsCode(yr) and c:IsAbleToHand()
end end
function cm.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and e:GetHandler():GetBattleTarget() function cm.filter1(c, ec, c2)
end return c:GetEquipTarget() == ec and c == c2
function cm.atkval(e,c) end
local tc = e:GetHandler():GetBattleTarget()
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
return math.max(tc:GetAttack(),tc:GetDefense()) local c = e:GetHandler()
end local tc = e:GetHandler():GetEquipTarget()
function cm.filter1(c,ec,c2) local dg = eg:Filter(cm.filter1, nil, tc, c)
return c:GetEquipTarget()==ec and c==c2 local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl()
end if chk == 0 then return #dg > 0 and tc and zzx > 0 end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
local c=e:GetHandler() e:SetLabel(zz, sx, lv)
local tc=e:GetHandler():GetEquipTarget() Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
--local dg=eg:Filter(cm.filter1,nil,tc,c) end
local kx,zzx,sxx,zzjc,sxjc,zzl=it.sxbl()
if chk==0 then return tc and zzx>0 end function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local zz,sx,lv=it.sxblx(tp,kx,zzx,sxx,zzl) local c = e:GetHandler()
e:SetLabel(zz,sx,lv) local tc = c:GetEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) if not c:IsRelateToEffect(e) then return end
end local zz, sx, lv = e:GetLabel()
function cm.operation(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsPlayerCanSpecialSummonMonster(tp, c:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, 0, 0, lv, zz, sx) then return end
local c=e:GetHandler() c:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER + TYPE_TUNER, sx, zz, lv, 0, 0)
local tc=c:GetEquipTarget() Duel.SpecialSummonStep(c, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
if not c:IsRelateToEffect(e) then return end local e3 = Effect.CreateEffect(c)
local zz,sx,lv=e:GetLabel() e3:SetType(EFFECT_TYPE_SINGLE)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),0,TYPE_NORMAL+TYPE_MONSTER+TYPE_TUNER,0,0,lv,zz,sx) then return end e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
c:AddMonsterAttribute(TYPE_NORMAL+TYPE_MONSTER+TYPE_TUNER,sx,zz,lv,0,0) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_DEFENSE) e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
local e3=Effect.CreateEffect(c) e3:SetValue(LOCATION_REMOVED)
e3:SetType(EFFECT_TYPE_SINGLE) c:RegisterEffect(e3, true)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) local e2 = Effect.CreateEffect(c)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT) e2:SetType(EFFECT_TYPE_SINGLE)
e3:SetValue(LOCATION_REMOVED) e2:SetCode(EFFECT_UPDATE_ATTACK)
c:RegisterEffect(e3,true) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
local e2=Effect.CreateEffect(c) e2:SetRange(LOCATION_MZONE)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetValue(function(e1, c1)
e2:SetCode(EFFECT_UPDATE_ATTACK) return Duel.GetMatchingGroupCount(cm.vfilter, tp, LOCATION_GRAVE + QY_cw, 0, nil) * 500
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) end)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT) c:RegisterEffect(e2, true)
e2:SetRange(LOCATION_MZONE) Duel.SpecialSummonComplete()
e2:SetValue(function (e1,c1)
return Duel.GetMatchingGroupCount(cm.vfilter,tp,LOCATION_GRAVE+QY_cw,0,nil)*500 if not tc:IsImmuneToEffect(e) then
end) Duel.Equip(tp, tc, c)
c:RegisterEffect(e2 ,true) local e1 = Effect.CreateEffect(c)
Duel.SpecialSummonComplete() e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
if not tc:IsImmuneToEffect(e) then e1:SetCode(EFFECT_EQUIP_LIMIT)
Duel.Equip(tp,tc,c) e1:SetReset(RESET_EVENT + RESETS_STANDARD)
local e1=Effect.CreateEffect(c) e1:SetValue(cm.eqlimit)
e1:SetType(EFFECT_TYPE_SINGLE) tc:RegisterEffect(e1)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE) end
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
end
end end
function cm.vfilter(c) 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 end
function cm.eqlimit(e,c)
return e:GetOwner()==c function cm.eqlimit(e, c)
end return e:GetOwner() == c
end
function cm.cfilter(c,tp,rp)
return c:IsType(TYPE_EQUIP) function cm.cfilter(c, tp, rp)
end return c:IsType(TYPE_EQUIP)
function cm.cfilter2(c,tp) end
return c:GetOwner()==tp
end function cm.cfilter2(c, tp)
function cm.descon(e,tp,eg,ep,ev,re,r,rp) return c:GetOwner() == tp
return eg:IsExists(cm.cfilter,1,nil,tp,rp) and not eg:IsContains(e:GetHandler()) end
end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler() return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
local ec=e:GetLabelObject():GetLabel() end
return ec~=0
end function cm.descon2(e, tp, eg, ep, ev, re, r, rp)
function cm.filter6(c,e,tp,id,g) local c = e:GetHandler()
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil,c,id)~=0 local ec = e:GetLabelObject():GetLabel()
end return ec ~= 0
function cm.filter5(c,e,tp,tc) end
local o=true
if tc~=nil then function cm.filter6(c, e, tp, id, g)
o=c:CheckEquipTarget(tc) return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c, id) ~= 0
end end
return c:IsType(TYPE_EQUIP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and o
end function cm.filter5(c, e, tp, tc)
function cm.filter4(c,c2,id) local o = true
return c:CheckEquipTarget(c2) and not c:IsCode(m) and aux.IsCodeListed(c, yr) if tc ~= nil then
end o = c:CheckEquipTarget(tc)
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) end
local c=e:GetHandler() return c:IsType(TYPE_EQUIP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and o
if chk==0 then return c:IsLocation(QY_cw) end end
Duel.SendtoGrave(c,REASON_EFFECT+REASON_RETURN)
end function cm.filter4(c, c2, id)
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) return c:CheckEquipTarget(c2) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
local g2 = Duel.GetMatchingGroup( cm.filter5, tp, QY_kz, 0, nil,e,tp) end
local g1 = Duel.GetMatchingGroup( cm.filter6, tp, QY_gs, QY_gs, nil,e,tp,m,g2)
-- local g3 = g2:Filter(aux.TRUE, nil) function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk==0 then return Duel.GetLocationCount(tp,QY_mx)>0 and #g1>0 end local c = e:GetHandler()
local c=e:GetHandler() if chk == 0 then return c:IsLocation(QY_cw) end
Duel.SelectTarget(tp,Card.IsFaceup,tp,QY_gs,QY_gs,1,1,nil) Duel.SendtoGrave(c, REASON_EFFECT + REASON_RETURN)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
local tc=Duel.GetFirstTarget() local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
local g2 = Duel.GetMatchingGroup( cm.filter5, tp, QY_kz, 0, nil,e,tp,tc) local g1 = Duel.GetMatchingGroup(cm.filter6, tp, QY_gs, QY_gs, nil, e, tp, m, g2)
g2=g2:Select(tp, 1, 1, nil):GetFirst() -- local g3 = g2:Filter(aux.TRUE, nil)
if tc:IsRelateToEffect(e) then if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g1 > 0 end
Duel.Equip(tp,g2,tc) local c = e:GetHandler()
end Duel.SelectTarget(tp, Card.IsFaceup, tp, QY_gs, QY_gs, 1, 1, nil)
Duel.BreakEffect() end
if c:IsLocation(QY_cw) and c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT+REASON_RETURN) function cm.desop(e, tp, eg, ep, ev, re, r, rp)
end local c = e:GetHandler()
end local tc = Duel.GetFirstTarget()
\ No newline at end of file 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 cm, m, ofs = GetID()
local yr = 13020010 local yr = 13020010
xpcall(function() dofile("expansions/script/c16670000.lua") end,function() dofile("script/c16670000.lua") end)--引用库 xpcall(function() dofile("expansions/script/c16670000.lua") end, function() dofile("script/c16670000.lua") end) --引用库
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c, yr) aux.AddCodeList(c, yr)
aux.AddEquipSpellEffect(c,true,true,Card.IsFaceup,nil) 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) local e1 = xg.epp2(c, m, 4, EVENT_EQUIP, EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY, QY_mx, nil, nil, cm.target,
e1:SetCountLimit(1,m) cm.operation, true)
local e3=Effect.CreateEffect(c) e1:SetCountLimit(1, m)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m+1) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCost(cm.cost1) e3:SetCountLimit(1, m + 1)
e3:SetTarget(cm.sptg) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
c:RegisterEffect(e3) 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)
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)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(yr) and c:IsAbleToHand() return c:IsCode(yr) and c:IsAbleToHand()
end end
function cm.filter1(c,ec,c2)
return c:GetEquipTarget()==ec and c==c2 function cm.filter1(c, ec, c2)
end return c:GetEquipTarget() == ec and c == c2
function cm.filter2(c,ec,c2) end
return c:IsAbleToRemove()
end function cm.filter2(c, ec, c2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER)
local c=e:GetHandler() end
local tc=e:GetHandler():GetEquipTarget()
--local dg=eg:Filter(cm.filter1,nil,tc,c) function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local g1 = Duel.GetMatchingGroup( cm.filter2, tp, LOCATION_ONFIELD+LOCATION_GRAVE, LOCATION_ONFIELD+LOCATION_GRAVE, nil) local c = e:GetHandler()
if chk==0 then return tc and #g1>0 and c:IsAbleToRemove() end local tc = e:GetHandler():GetEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,2,0,0) local dg = eg:Filter(cm.filter1, nil, tc, c)
end local g1 = Duel.GetMatchingGroup(cm.filter2, tp, QY_gs, QY_gs, nil)
function cm.operation(e,tp,eg,ep,ev,re,r,rp) if chk == 0 then return #dg > 0 and tc and #g1 > 0 and c:IsAbleToRemove() end
local c=e:GetHandler() Duel.SetOperationInfo(0, CATEGORY_REMOVE, c, 2, 0, 0)
local tc=c:GetEquipTarget() end
if not c:IsRelateToEffect(e) then return end
local g=Group.CreateGroup() function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, LOCATION_ONFIELD+LOCATION_GRAVE, LOCATION_ONFIELD+LOCATION_GRAVE,1,1, nil):GetFirst() local c = e:GetHandler()
g:AddCard(g1) local tc = c:GetEquipTarget()
g:AddCard(c) if not c:IsRelateToEffect(e) then return end
Duel.Remove(g, POS_FACEUP, REASON_EFFECT) local g = Group.CreateGroup()
if g1:IsLocation(QY_cw) and g1:IsType(TYPE_MONSTER) then local g1 = Duel.SelectMatchingCard(tp, cm.filter2, tp, QY_gs, QY_gs, 1, 1, nil):GetFirst()
local e1=Effect.CreateEffect(c) g:AddCard(g1)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) g:AddCard(c)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
e1:SetCountLimit(1) if g1:IsLocation(QY_cw) then
e1:SetLabel(Duel.GetTurnCount()) local e1 = Effect.CreateEffect(c)
e1:SetCondition(cm.spcon) e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetOperation(cm.spop) e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
e1:SetRange(LOCATION_REMOVED) e1:SetCountLimit(1)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2) e1:SetCondition(cm.spcon)
else e1:SetOperation(cm.spop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY) e1:SetRange(LOCATION_REMOVED)
end if Duel.GetCurrentPhase() <= PHASE_STANDBY then
g1:RegisterEffect(e1, true) e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
end else
if g1:IsLocation(QY_cw) and not g1:IsType(TYPE_MONSTER) then e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
local e1=Effect.CreateEffect(c) end
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) g1:RegisterEffect(e1, true)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) end
e1:SetCountLimit(1) end
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon2) function cm.spcon(e, tp, eg, ep, ev, re, r, rp)
e1:SetOperation(cm.spop2) return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
e1:SetRange(LOCATION_REMOVED) end
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2) function cm.spop(e, tp, eg, ep, ev, re, r, rp)
else local c = e:GetHandler()
e1:SetReset(RESET_PHASE+PHASE_STANDBY) Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
end end
g1:RegisterEffect(e1, true)
end function cm.cfilter(c, tp, rp)
end return c:IsPreviousControler(tp)
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp) and rp == 1 - tp and c:IsType(TYPE_EQUIP)
return Duel.GetTurnCount()~=e:GetLabel() and tp==Duel.GetTurnPlayer() end
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler() return eg:IsExists(cm.cfilter, 1, nil, tp, rp) and not eg:IsContains(e:GetHandler())
Duel.SendtoHand(c,nil,REASON_EFFECT) end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.filter6(c, e, tp, id, g)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tp==Duel.GetTurnPlayer() return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil, c) ~= 0
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function cm.filter5(c, e, tp, tc)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) return c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and c:IsSSetable()
end end
function cm.cfilter(c,tp,rp) function cm.filter4(c, c2)
return c:IsPreviousControler(tp) return c2:CheckEquipTarget(c) and not c:IsCode(m) and aux.IsCodeListed(c, yr)
and rp==1-tp and c:IsType(TYPE_EQUIP) end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
return eg:IsExists(cm.cfilter,1,nil,tp,rp) and not eg:IsContains(e:GetHandler()) local g2 = Duel.GetMatchingGroup(cm.filter5, tp, QY_kz, 0, nil, e, tp)
end if chk == 0 then return Duel.GetLocationCount(tp, QY_mx) > 0 and #g2 > 0 end
function cm.filter6(c,e,tp,id,g) end
return c:IsCanBeEffectTarget(e) and #g:Filter(cm.filter4, nil,c)~=0
end function cm.con4_4(e, tp, eg, ep, ev, re, r, rp)
function cm.filter5(c,e,tp,tc) return Duel.GetCurrentChain() == 0
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(m) and aux.IsCodeListed(c, yr) and c:IsSSetable() end
end
function cm.filter4(c,c2) function cm.op4_5(e, tp, eg, ep, ev, re, r, rp)
return c2:CheckEquipTarget(c) and not c:IsCode(m) and aux.IsCodeListed(c, yr) local tc = e:GetLabelObject()
end if tc:GetFlagEffect(m) ~= 0 then return end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local e4_5_1 = tc:GetActivateEffect()
local g2 = Duel.GetMatchingGroup( cm.filter5, tp, QY_kz, 0, nil,e,tp) e4_5_1:SetProperty(nil)
if chk==0 then return Duel.GetLocationCount(tp,QY_mx)>0 and #g2>0 end e4_5_1:SetHintTiming(0)
end e4_5_1:SetCondition(cm.TRUE)
e:Reset()
function cm.con4_4(e,tp,eg,ep,ev,re,r,rp) end
return Duel.GetCurrentChain()==0
end function cm.desop(e, tp, eg, ep, ev, re, r, rp)
function cm.op4_5(e,tp,eg,ep,ev,re,r,rp) local c = e:GetHandler()
local tc=e:GetLabelObject() local g2 = Duel.SelectMatchingCard(tp, cm.filter5, tp, QY_kz, 0, 1, 1, nil, e, tp):GetFirst()
if tc:GetFlagEffect(m)~=0 then return end if Duel.SSet(tp, g2, tp) ~= 0 then
local e4_5_1=tc:GetActivateEffect() if c:IsType(TYPE_TRAP + TYPE_QUICKPLAY) then
e4_5_1:SetProperty(nil) local e1 = Effect.CreateEffect(c)
e4_5_1:SetHintTiming(0) e1:SetType(EFFECT_TYPE_SINGLE)
e4_5_1:SetCondition(aux.TRUE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e:Reset() e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
end e1:SetReset(RESET_EVENT + RESETS_STANDARD)
function cm.desop(e,tp,eg,ep,ev,re,r,rp) g2:RegisterEffect(e1)
local c=e:GetHandler() local e2 = e1:Clone()
local g2 = Duel.SelectMatchingCard(tp, cm.filter5, tp, QY_kz, 0,1,1, nil,e,tp):GetFirst() e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
if Duel.SSet(tp, g2 ,tp)~=0 then g2:RegisterEffect(e2)
if c:IsType(TYPE_TRAP+TYPE_QUICKPLAY) then else
local e1=Effect.CreateEffect(c) local tc = g2
e1:SetType(EFFECT_TYPE_SINGLE) local e4_4 = g2:GetActivateEffect()
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) if e4_4 ~= nil then
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) local oq = e4_4:GetCondition()
e1:SetReset(RESET_EVENT+RESETS_STANDARD) local ow = e4_4:GetProperty()
g2:RegisterEffect(e1) e4_4:SetProperty(e4_4:GetProperty(), EFFECT_FLAG2_COF)
local e2=e1:Clone() e4_4:SetHintTiming(0, 0x1e0 + TIMING_CHAIN_END)
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e4_4:SetCondition(function(e, tp, eg, ep, ev, re, r, rp)
g2:RegisterEffect(e2) return Duel.GetCurrentChain() == 0 and (not oq or oq(e, tp, eg, ep, ev, re, r, rp))
else end)
local tc=g2 tc:RegisterFlagEffect(m, RESET_EVENT + 0x1fe0000, 0, 1)
local e4_4=g2:GetActivateEffect()
if e4_4~=nil then local e4_5 = Effect.CreateEffect(c)
e4_4:SetProperty(e4_4:GetProperty(),EFFECT_FLAG2_COF) e4_5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e4_4:SetHintTiming(0,0x1e0+TIMING_CHAIN_END) e4_5:SetCode(EVENT_ADJUST)
local oq=e4_4:GetCondition() e4_5:SetOperation(function(e, tp, eg, ep, ev, re, r, rp)
local ow=e4_4:GetProperty() if tc:GetFlagEffect(m) ~= 0 then return end
e4_4:SetCondition(function (e,tp,eg,ep,ev,re,r,rp) -- local e4_5_1 = tc:GetActivateEffect()
return Duel.GetCurrentChain()==0 and (not oq or oq(e,tp,eg,ep,ev,re,r,rp)) if ow ~= nil then
end) e4_4:SetProperty(ow)
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1) end
local e4_5=Effect.CreateEffect(c) -- e4_4:SetHintTiming(table.unpack(ow))
e4_5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) if oq ~= nil then
e4_5:SetCode(EVENT_ADJUST) e4_4:SetCondition(oq)
e4_5:SetOperation(function (e,tp,eg,ep,ev,re,r,rp) end
local tc=e:GetLabelObject() e:Reset()
if tc:GetFlagEffect(m)~=0 then return end end)
local e4_5_1=tc:GetActivateEffect() e4_5:SetLabelObject(g2)
e4_5_1:SetProperty(ow) Duel.RegisterEffect(e4_5, tp)
e4_5_1:SetHintTiming(table.unpack(ow)) end
e4_5_1:SetCondition(oq) end
e:Reset() end
end)
e4_5:SetLabelObject(g2)
Duel.RegisterEffect(e4_5,tp)
end
end
end
end end
...@@ -34,7 +34,7 @@ function xg.epp(c, id, su, ...) --XG.epp(c,id,su,...) 不推荐使用 ...@@ -34,7 +34,7 @@ function xg.epp(c, id, su, ...) --XG.epp(c,id,su,...) 不推荐使用
end end
for _, o in pairs(l2) do for _, o in pairs(l2) do
if su[o] == nil or su[o] == "" then if su[o] == nil or su[o] == "" then
su[o] = cm.TRUE su[o] = aux.TRUE
end end
end end
else else
...@@ -53,7 +53,7 @@ function xg.epp(c, id, su, ...) --XG.epp(c,id,su,...) 不推荐使用 ...@@ -53,7 +53,7 @@ function xg.epp(c, id, su, ...) --XG.epp(c,id,su,...) 不推荐使用
end end
end end
end end
e1:SetDescription(cm.Stringid(id, su["Description"])) e1:SetDescription(aux.Stringid(id, su["Description"]))
e1:SetCategory(su["Category"]) e1:SetCategory(su["Category"])
e1:SetProperty(su["Property"]) e1:SetProperty(su["Property"])
e1:SetType(su["Type"]) e1:SetType(su["Type"])
...@@ -129,7 +129,7 @@ function xg.epp2(c, id, cf, co, ta, qy, h1, h2, h3, h4, zc) --XG.epp2(c,m,2,nil, ...@@ -129,7 +129,7 @@ function xg.epp2(c, id, cf, co, ta, qy, h1, h2, h3, h4, zc) --XG.epp2(c,m,2,nil,
end end
function xg.ky(tp, id, zh) --简易选择是否 function xg.ky(tp, id, zh) --简易选择是否
return Duel.SelectYesNo(tp, cm.Stringid(id, zh)) return Duel.SelectYesNo(tp, aux.Stringid(id, zh))
end end
--失落之魂 --失落之魂
...@@ -192,7 +192,7 @@ hj = hj or {} ...@@ -192,7 +192,7 @@ hj = hj or {}
cm = it cm = it
function cm.GetEffectValue(e, ...) --检测e是否函数,是的场合执行函数内容 function cm.GetEffectValue(e, ...) --检测e是否函数,是的场合执行函数内容
local v = e:GetValue() local v = e:GetValue()
if cm.GetValueType(v) == "function" then if aux.GetValueType(v) == "function" then
return v(e, ...) return v(e, ...)
else else
return v return v
......
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