Commit 0638fd19 authored by POLYMER's avatar POLYMER

fix

parent 5dc2a615
...@@ -91,6 +91,23 @@ function cm.spop2(e, tp, eg, ep, ev, re, r, rp) ...@@ -91,6 +91,23 @@ function cm.spop2(e, tp, eg, ep, ev, re, r, rp)
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:SetReset(RESET_EVENT + RESETS_REDIRECT)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(cm.atkval)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
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
...@@ -6,8 +6,9 @@ function cm.initial_effect(c) ...@@ -6,8 +6,9 @@ function cm.initial_effect(c)
c:SetSPSummonOnce(m) c:SetSPSummonOnce(m)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFunRep(c, 13020000, aux.FilterBoolFunction(Card.IsType, TYPE_EFFECT), 1, 127, true, true) --aux.AddFusionProcCodeFunRep(c, 13020000, aux.FilterBoolFunction(Card.IsType, TYPE_EFFECT), 1, 127, true, true)
local e1 = aux.AddContactFusionProcedure(c, cm.ffilter, LOCATION_ONFIELD + LOCATION_HAND, 0, Duel.Remove, POS_FACEUP, aux.AddFusionProcFun2(c, cm.filter66, aux.FilterBoolFunction(Card.IsType, TYPE_EFFECT), 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) REASON_COST + REASON_MATERIAL):SetValue(SUMMON_VALUE_SELF)
local e2 = Effect.CreateEffect(c) local e2 = Effect.CreateEffect(c)
...@@ -30,6 +31,10 @@ function cm.initial_effect(c) ...@@ -30,6 +31,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.filter66(c)
return aux.IsCodeListed(c, yr)
end
function cm.ffilter(c, fc, sub, mg, sg) function cm.ffilter(c, fc, sub, mg, sg)
return c:IsAbleToRemoveAsCost() and (c:GetOriginalType() & TYPE_UNION ~= 0 or c:GetOriginalType() & TYPE_EQUIP ~= 0) return c:IsAbleToRemoveAsCost() and (c:GetOriginalType() & TYPE_UNION ~= 0 or c:GetOriginalType() & TYPE_EQUIP ~= 0)
end end
...@@ -38,7 +43,7 @@ function cm.filter(c, c2) ...@@ -38,7 +43,7 @@ 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 aux.AddContactFusionProcedure(c, filter, self_location, opponent_location, mat_operation, ...) function cm.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 = { ... }
...@@ -86,13 +91,15 @@ function cm.desop(e, tp, eg, ep, ev, re, r, rp) ...@@ -86,13 +91,15 @@ function cm.desop(e, tp, eg, ep, ev, re, r, rp)
g = g:GetFirst() g = g:GetFirst()
local mg = Group.CreateGroup() local mg = Group.CreateGroup()
mg:AddCard(c) mg:AddCard(c)
local g2 = Duel.GetMatchingGroup(cm.TRUE, tp, 0, LOCATION_MZONE, nil) local g2 = Duel.GetMatchingGroup(aux.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
......
...@@ -4,18 +4,30 @@ local yr = 13020010 ...@@ -4,18 +4,30 @@ 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 e1 = xg.epp2(c, m, 1, nil, 3, QY_sp, cm.setcon2, cm.cost, cm.target, cm.operation, true) --使用库内函数进行便捷注册 -- local e1 = xg.epp2(c, m, 1, nil, 3, QY_sp, cm.setcon2, cm.cost, cm.target, cm.operation, true) --使用库内函数进行便捷注册
local e2 = e1:Clone() -- local e2 = e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O) -- e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) -- e2:SetCode(EVENT_FREE_CHAIN)
e2:SetLabel(m) -- e2:SetLabel(m)
e2:SetCondition(cm.setcon) -- e2:SetCondition(cm.setcon)
c:RegisterEffect(e2) -- c:RegisterEffect(e2)
local e0 = Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_EQUIP)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetRange(LOCATION_HAND)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetCost(cm.cost)
e0:SetCondition(cm.setcon)
e0:SetTarget(cm.target)
e0:SetOperation(cm.operation)
c:RegisterEffect(e0)
local e3 = xg.epp2(c, m, 4, EVENT_EQUIP, nil, QY_md + QY_cw, cm.setcon3, nil, nil, cm.operation2, true) local e3 = xg.epp2(c, m, 4, EVENT_EQUIP, nil, QY_md + QY_cw, cm.setcon3, nil, nil, cm.operation2, true)
e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN) e3:SetCountLimit(1, m + EFFECT_COUNT_CODE_CHAIN)
if cm.gl == nil then if cm.gl == nil then
cm.gl = true cm.gl = true
cm[0] = 6 cm[0] = 0
cm[1] = 0 cm[1] = 0
end end
end end
...@@ -29,7 +41,10 @@ function cm.filter(c, e, g) ...@@ -29,7 +41,10 @@ function cm.filter(c, e, g)
return c:IsCanBeEffectTarget(e) and #g2 > 0 return c:IsCanBeEffectTarget(e) and #g2 > 0
end end
function cm.filter2(c) function cm.filter2(c, tc)
if tc and not c:CheckEquipTarget(tc) then
return false
end
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
...@@ -42,7 +57,9 @@ function cm.setcon(e, tp, eg, ep, ev, re, r, rp) ...@@ -42,7 +57,9 @@ 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 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 Duel.GetCurrentChain() ~= 0 and #g2 > 0 -- and #g4<=0 --return Duel.GetCurrentChain() ~= 0 and #g2 > 0 -- and #g4<=0
return g2 and #g2 > 0 or
(Duel.GetTurnPlayer() == e:GetHandlerPlayer() and Duel.IsExistingMatchingCard(cm.filter2, tp, LOCATION_DECK + LOCATION_GRAVE, 0, 1, nil))
end end
function cm.setcon2(e, tp, eg, ep, ev, re, r, rp) function cm.setcon2(e, tp, eg, ep, ev, re, r, rp)
...@@ -61,7 +78,7 @@ end ...@@ -61,7 +78,7 @@ end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc) function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler() local c = e:GetHandler()
local oc = LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK local oc = LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK
if e:GetLabel() == m then if Duel.GetTurnPlayer() ~= e:GetHandlerPlayer() then
oc = QY_sk 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)
...@@ -77,11 +94,11 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp) ...@@ -77,11 +94,11 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local tc = Duel.GetFirstTarget() 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 e:GetLabel() == m then if Duel.GetTurnPlayer() ~= e:GetHandlerPlayer() 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, Card.CheckEquipTarget, tp, oc, 0, 1, 1, nil, tc):GetFirst() local tcg = Duel.SelectMatchingCard(tp, cm.filter2, tp, oc, 0, 1, 1, nil, tc):GetFirst()
Duel.Equip(tp, tcg, tc, true) Duel.Equip(tp, tcg, tc, true)
end end
end end
...@@ -107,45 +124,64 @@ function cm.operation2(e, tp, eg, ep, ev, re, r, rp) ...@@ -107,45 +124,64 @@ function cm.operation2(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
cm[tp] = cm[tp] + 1 cm[tp] = cm[tp] + 1
local num = cm[tp] local num = cm[tp]
local g1 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE, 0, nil):GetFirst() --local g1 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE, 0, nil):GetFirst()
local g2 = Duel.GetMatchingGroup(cm.filter6, tp, LOCATION_GRAVE, 0, g1, e, tp) local g2 = Duel.GetMatchingGroup(cm.filter6, tp, LOCATION_GRAVE, 0, g1, e, tp)
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl() 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 if Duel.Recover(tp, 200, REASON_EFFECT) > 0 then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK) if num >= 6 and #g2 > 0 and zzx > 0 and xg.ky(tp, m, 1) then --g1 ~= nil and
local g = Duel.SelectMatchingCard(tp, cm.filter5, tp, LOCATION_GRAVE, 0, 1, 1, nil) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) local g = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_GRAVE, 0, 1, 3, nil)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
local tc = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp):GetFirst() Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl) local tc = Duel.SelectMatchingCard(tp, cm.filter6, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp):GetFirst()
if tc and Duel.IsPlayerCanSpecialSummonMonster(tp, tc:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER, 0, 0, lv, zz, sx) then local zz, sx, lv = it.sxblx(tp, kx, zzx, sxx, zzl)
tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0) if tc and Duel.IsPlayerCanSpecialSummonMonster(tp, tc:GetCode(), 0, TYPE_NORMAL + TYPE_MONSTER, 0, 0, lv, zz, sx) then
Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE) tc:AddMonsterAttribute(TYPE_NORMAL + TYPE_MONSTER, sx, zz, lv, 0, 0)
local e3 = Effect.CreateEffect(c) Duel.SpecialSummonStep(tc, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
e3:SetType(EFFECT_TYPE_SINGLE) local e3 = Effect.CreateEffect(c)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetReset(RESET_EVENT + RESETS_REDIRECT) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(LOCATION_REMOVED) e3:SetReset(RESET_EVENT + RESETS_REDIRECT)
tc:RegisterEffect(e3, true) e3:SetValue(LOCATION_REMOVED)
Duel.SpecialSummonComplete() tc:RegisterEffect(e3, true)
local e2 = Effect.CreateEffect(c)
local e4 = Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE)
e4:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION) e2:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetTargetRange(1, 0) e2:SetReset(RESET_EVENT + RESETS_REDIRECT)
e4:SetTarget(cm.sumlimit) e2:SetValue(cm.atkval)
Duel.RegisterEffect(e4, true) tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1, 0)
e4:SetTarget(cm.sumlimit)
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
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)
Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
Duel.RegisterFlagEffect(tp, m, SD_js, 0, 1)
end end
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)
Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
Duel.RegisterFlagEffect(tp, m, SD_js, 0, 1)
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
...@@ -4,10 +4,15 @@ local yr = 13020010 ...@@ -4,10 +4,15 @@ 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, nil, nil) --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, 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)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_DISABLE)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c) 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)
...@@ -22,7 +27,7 @@ function cm.initial_effect(c) ...@@ -22,7 +27,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function aux.AddEquipSpellEffect(c, is_self, is_opponent, filter, eqlimit, pause, skip_target) function cm.AddEquipSpellEffect(c, is_self, is_opponent, filter, eqlimit, pause, skip_target)
local value = (type(eqlimit) == "function") and eqlimit or 1 local value = (type(eqlimit) == "function") and eqlimit or 1
if pause == nil then pause = false end if pause == nil then pause = false end
if skip_target == nil then skip_target = false end if skip_target == nil then skip_target = false end
...@@ -82,9 +87,10 @@ end ...@@ -82,9 +87,10 @@ end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc) function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler() local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget() local tc = e:GetHandler():GetEquipTarget()
local dg = eg:Filter(cm.filter1, nil, tc, c) --local dg = eg:Filter(cm.filter1, nil, tc, c)
local g = Duel.GetMatchingGroup(cm.filter, tp, LOCATION_DECK + QY_md, 0, nil) local g = Duel.GetMatchingGroup(cm.filter, tp, LOCATION_DECK + QY_md, 0, nil)
if chk == 0 then return #dg > 0 and tc and tc:IsCanChangePosition() and #g > 0 end --if chk == 0 then return #dg > 0 and tc and tc:IsCanChangePosition() and #g > 0 end
if chk == 0 then return tc and tc:IsCanChangePosition() and #g > 0 end
Duel.SetOperationInfo(0, CATEGORY_POSITION, tc, 1, 0, 0) Duel.SetOperationInfo(0, CATEGORY_POSITION, tc, 1, 0, 0)
end end
...@@ -92,14 +98,17 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp) ...@@ -92,14 +98,17 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
local tc = c:GetEquipTarget() 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_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK) ~= 0 then --if tc and Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK) ~= 0 then
if tc and Duel.ChangePosition(tc, POS_FACEDOWN_DEFENSE) ~= 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_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK) --Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE, POS_FACEUP_ATTACK,
POS_FACEUP_ATTACK)
end end
end end
end end
...@@ -120,11 +129,11 @@ function cm.filter6(c, e, tp, id, g) ...@@ -120,11 +129,11 @@ function cm.filter6(c, e, tp, id, g)
end end
function cm.filter5(c, e, tp) function cm.filter5(c, e, tp)
return c:IsType(TYPE_EQUIP) return c:IsType(TYPE_EQUIP) or c:IsType(TYPE_UNION)
end end
function cm.filter4(c, c2) function cm.filter4(c, c2)
return c2:CheckEquipTarget(c) and not c:IsCode(m) return c:CheckEquipTarget(c2) and not c:IsCode(m)
end end
function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk) function cm.cost(e, tp, eg, ep, ev, re, r, rp, chk)
...@@ -147,6 +156,7 @@ function cm.desop(e, tp, eg, ep, ev, re, r, rp) ...@@ -147,6 +156,7 @@ function cm.desop(e, tp, eg, ep, ev, re, r, rp)
local g2 = Duel.GetMatchingGroup(cm.filter5, tp, LOCATION_GRAVE + QY_cw, 0, nil, e, tp) 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() 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) Duel.SpecialSummon(g1, 0, tp, tp, false, false, POS_FACEUP)
g2 = g2:Filter(cm.filter4, nil, g1) --g2 = g2:Filter(cm.filter4, nil, g1)
g2 = g2:FilterSelect(tp, cm.filter4, 1, 1, nil, g1):GetFirst()
Duel.Equip(tp, g2, g1, true) Duel.Equip(tp, g2, g1, true)
end end
...@@ -20,6 +20,12 @@ function cm.initial_effect(c) ...@@ -20,6 +20,12 @@ function cm.initial_effect(c)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
c:RegisterEffect(e3) 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) local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD_P) e4:SetCode(EVENT_LEAVE_FIELD_P)
...@@ -51,6 +57,16 @@ function cm.filter(c) ...@@ -51,6 +57,16 @@ 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()
end
function cm.atkval(e, c)
local tc = e:GetHandler():GetBattleTarget()
return math.max(tc:GetAttack(), tc:GetDefense())
end
function cm.filter1(c, ec, c2) function cm.filter1(c, ec, c2)
return c:GetEquipTarget() == ec and c == c2 return c:GetEquipTarget() == ec and c == c2
end end
...@@ -58,9 +74,10 @@ end ...@@ -58,9 +74,10 @@ end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc) function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler() local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget() local tc = e:GetHandler():GetEquipTarget()
local dg = eg:Filter(cm.filter1, nil, tc, c) --local dg = eg:Filter(cm.filter1, nil, tc, c)
local kx, zzx, sxx, zzjc, sxjc, zzl = it.sxbl() 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 #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) 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, c, 1, 0, 0) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
......
...@@ -14,9 +14,29 @@ function cm.initial_effect(c) ...@@ -14,9 +14,29 @@ function cm.initial_effect(c)
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:SetCountLimit(1, m + 1) e3:SetCountLimit(1, m + 1)
e3:SetCost(cm.cost1)
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)
...@@ -28,15 +48,18 @@ function cm.filter1(c, ec, c2) ...@@ -28,15 +48,18 @@ function cm.filter1(c, ec, c2)
end end
function cm.filter2(c, ec, c2) function cm.filter2(c, ec, c2)
return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) return c:IsAbleToRemove() -- and c:IsType(TYPE_MONSTER)
end end
function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc) function cm.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local c = e:GetHandler() local c = e:GetHandler()
local tc = e:GetHandler():GetEquipTarget() local tc = e:GetHandler():GetEquipTarget()
local dg = eg:Filter(cm.filter1, nil, tc, c) --local dg = eg:Filter(cm.filter1, nil, tc, c)
local g1 = Duel.GetMatchingGroup(cm.filter2, tp, QY_gs, QY_gs, nil) -- 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 -- 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) Duel.SetOperationInfo(0, CATEGORY_REMOVE, c, 2, 0, 0)
end end
...@@ -45,11 +68,14 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp) ...@@ -45,11 +68,14 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp)
local tc = c:GetEquipTarget() local tc = c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local g = Group.CreateGroup() 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, 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(g1)
g:AddCard(c) g:AddCard(c)
Duel.Remove(g, POS_FACEUP, REASON_EFFECT) Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
if g1:IsLocation(QY_cw) then -- if g1:IsLocation(QY_cw) then
if g1:IsLocation(QY_cw) and g1:IsType(TYPE_MONSTER) then
local e1 = Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_STANDBY) e1:SetCode(EVENT_PHASE + PHASE_STANDBY)
...@@ -61,16 +87,46 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp) ...@@ -61,16 +87,46 @@ function cm.operation(e, tp, eg, ep, ev, re, r, rp)
if Duel.GetCurrentPhase() <= PHASE_STANDBY then if Duel.GetCurrentPhase() <= PHASE_STANDBY then
e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2) e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else 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) e1:SetReset(RESET_PHASE + PHASE_STANDBY, 2)
else
e1:SetReset(RESET_PHASE + PHASE_STANDBY)
end end
g1:RegisterEffect(e1, true) g1:RegisterEffect(e1, true)
end end
end end
function cm.spcon2(e, tp, eg, ep, ev, re, r, rp)
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)
end
function cm.spcon(e, tp, eg, ep, ev, re, r, rp) 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 and
tp == Duel.GetTurnPlayer()
end end
-- function cm.spcon(e, tp, eg, ep, ev, re, r, rp)
-- return Duel.GetTurnCount() ~= e:GetLabel() and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
-- end
function cm.spop(e, tp, eg, ep, ev, re, r, rp) function cm.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler() local c = e:GetHandler()
Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
...@@ -112,7 +168,7 @@ function cm.op4_5(e, tp, eg, ep, ev, re, r, rp) ...@@ -112,7 +168,7 @@ function cm.op4_5(e, tp, eg, ep, ev, re, r, rp)
local e4_5_1 = tc:GetActivateEffect() local e4_5_1 = tc:GetActivateEffect()
e4_5_1:SetProperty(nil) e4_5_1:SetProperty(nil)
e4_5_1:SetHintTiming(0) e4_5_1:SetHintTiming(0)
e4_5_1:SetCondition(cm.TRUE) e4_5_1:SetCondition(aux.TRUE)
e:Reset() e:Reset()
end end
......
...@@ -5,7 +5,7 @@ function c60158214.initial_effect(c) ...@@ -5,7 +5,7 @@ function c60158214.initial_effect(c)
--1xg --1xg
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60158214,0)) e1:SetDescription(aux.Stringid(60158214,0))
e1:SetCategory(CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,60158214) e1:SetCountLimit(1,60158214)
......
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