Commit a9790ce7 authored by xiaoye's avatar xiaoye

更改判定增加值接口

parent a66ba2da
...@@ -341,19 +341,43 @@ function VgD.CardTriggerOperation(chkop) ...@@ -341,19 +341,43 @@ function VgD.CardTriggerOperation(chkop)
local c = e:GetHandler() local c = e:GetHandler()
if c:IsRace(TRIGGER_CRITICAL_STRIKE) then if c:IsRace(TRIGGER_CRITICAL_STRIKE) then
local g1 = VgF.SelectMatchingCard(HINTMSG_CRITICAL_STRIKE, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g1 = VgF.SelectMatchingCard(HINTMSG_CRITICAL_STRIKE, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.StarUp(c, g1, c.trigger_star_up or 1, nil) local star_up = c.trigger_star_up or 1
local atk_up = c.trigger_atk_up or 10000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_STAR) then
star_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_STAR):GetValue()
end
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
VgF.StarUp(c, g1, star_up, nil)
local g2 = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g2 = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g2, c.trigger_atk_up or 10000, nil) VgF.AtkUp(c, g2, atk_up, nil)
elseif c:IsRace(TRIGGER_DRAW) then elseif c:IsRace(TRIGGER_DRAW) then
local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g, c.trigger_atk_up or 10000, nil) local atk_up = c.trigger_atk_up or 10000
Duel.Draw(tp, c.trigger_draw or 1, REASON_TRIGGER) local draw = c.trigger_draw or 1
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW) then
draw = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW):GetValue()
end
VgF.AtkUp(c, g, atk_up, nil)
Duel.Draw(tp, draw, REASON_TRIGGER)
elseif c:IsRace(TRIGGER_HEAL) then elseif c:IsRace(TRIGGER_HEAL) then
local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g, c.trigger_atk_up or 10000, nil) local atk_up = c.trigger_atk_up or 10000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
VgF.AtkUp(c, g, atk_up, nil)
if Duel.GetMatchingGroupCount(nil, tp, LOCATION_DAMAGE, 0, nil) >= Duel.GetMatchingGroupCount(nil, tp, 0, LOCATION_DAMAGE, nil) then if Duel.GetMatchingGroupCount(nil, tp, LOCATION_DAMAGE, 0, nil) >= Duel.GetMatchingGroupCount(nil, tp, 0, LOCATION_DAMAGE, nil) then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODROP) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODROP)
local sg = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_DAMAGE, 0, c.trigger_recover or 1, c.trigger_recover or 1, nil) local recover = c.trigger_recover or 1
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_RECOVER) then
recover = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_RECOVER):GetValue()
end
local sg = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_DAMAGE, 0, recover, recover, nil)
if sg:GetCount() > 0 then if sg:GetCount() > 0 then
VgF.Sendto(LOCATION_DROP, sg, REASON_TRIGGER) VgF.Sendto(LOCATION_DROP, sg, REASON_TRIGGER)
Duel.Recover(tp, sg:GetCount(), REASON_RULE) Duel.Recover(tp, sg:GetCount(), REASON_RULE)
...@@ -361,7 +385,11 @@ function VgD.CardTriggerOperation(chkop) ...@@ -361,7 +385,11 @@ function VgD.CardTriggerOperation(chkop)
end end
elseif c:IsRace(TRIGGER_ADVANCE) then elseif c:IsRace(TRIGGER_ADVANCE) then
local g = Duel.GetMatchingGroup(VgF.IsSequence, tp, LOCATION_MZONE, 0, nil, 0, 4, 5) local g = Duel.GetMatchingGroup(VgF.IsSequence, tp, LOCATION_MZONE, 0, nil, 0, 4, 5)
VgF.AtkUp(c, g, c.trigger_atk_up or 10000, nil) local atk_up = c.trigger_atk_up or 10000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
VgF.AtkUp(c, g, atk_up, nil)
end end
if chkop == 'Damage' then if chkop == 'Damage' then
if c:IsRace(TRIGGER_SUPER) then if c:IsRace(TRIGGER_SUPER) then
...@@ -376,14 +404,22 @@ function VgD.CardTriggerOperation(chkop) ...@@ -376,14 +404,22 @@ function VgD.CardTriggerOperation(chkop)
if true then if true then
table.insert(ops, VgF.Stringid(VgID + 5, 4)) table.insert(ops, VgF.Stringid(VgID + 5, 4))
table.insert(sel, function () table.insert(sel, function ()
Duel.Draw(tp, c.trigger_draw or 1, REASON_TRIGGER) local draw = c.trigger_draw or 1
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW) then
draw = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW):GetValue()
end
Duel.Draw(tp, draw, REASON_TRIGGER)
end) end)
end end
if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then
table.insert(ops, VgF.Stringid(VgID + 5, 5)) table.insert(ops, VgF.Stringid(VgID + 5, 5))
table.insert(sel, function () table.insert(sel, function ()
local atk_up = c.trigger_atk_up or 100000000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g, c.trigger_atk_up or 100000000, nil) VgF.AtkUp(c, g, atk_up, nil)
end) end)
end end
if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then
...@@ -430,14 +466,22 @@ function VgD.CardTriggerOperation(chkop) ...@@ -430,14 +466,22 @@ function VgD.CardTriggerOperation(chkop)
if true then if true then
table.insert(ops, VgF.Stringid(VgID + 5, 4)) table.insert(ops, VgF.Stringid(VgID + 5, 4))
table.insert(sel, function () table.insert(sel, function ()
Duel.Draw(tp, c.trigger_draw or 1, REASON_TRIGGER) local draw = c.trigger_draw or 1
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW) then
draw = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW):GetValue()
end
Duel.Draw(tp, draw, REASON_TRIGGER)
end) end)
end end
if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then
table.insert(ops, VgF.Stringid(VgID + 5, 5)) table.insert(ops, VgF.Stringid(VgID + 5, 5))
table.insert(sel, function () table.insert(sel, function ()
local atk_up = c.trigger_atk_up or 100000000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g, c.trigger_atk_up or 100000000, nil) VgF.AtkUp(c, g, atk_up, nil)
end) end)
end end
if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then
...@@ -480,14 +524,22 @@ function VgD.CardTriggerOperation(chkop) ...@@ -480,14 +524,22 @@ function VgD.CardTriggerOperation(chkop)
if true then if true then
table.insert(ops, VgF.Stringid(VgID + 5, 4)) table.insert(ops, VgF.Stringid(VgID + 5, 4))
table.insert(sel, function () table.insert(sel, function ()
Duel.Draw(tp, c.trigger_draw or 1, REASON_TRIGGER) local draw = c.trigger_draw or 1
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW) then
draw = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_DRAW):GetValue()
end
Duel.Draw(tp, draw, REASON_TRIGGER)
end) end)
end end
if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then if VgF.IsExistingMatchingCard(nil, tp, LOCATION_MZONE, 0, 1, nil) then
table.insert(ops, VgF.Stringid(VgID + 5, 5)) table.insert(ops, VgF.Stringid(VgID + 5, 5))
table.insert(sel, function () table.insert(sel, function ()
local atk_up = c.trigger_atk_up or 100000000
if c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK) then
atk_up = c:IsHasEffect(EFFECT_CHANGE_TRIGGER_ATK):GetValue()
end
local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil) local g = VgF.SelectMatchingCard(HINTMSG_ATKUP, e, tp, nil, tp, LOCATION_MZONE, 0, 1, 1, nil)
VgF.AtkUp(c, g, c.trigger_atk_up or 100000000, nil) VgF.AtkUp(c, g, atk_up, nil)
end) end)
end end
if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then if VgD.OperationWhenCardTrigger(e, tp, eg, ep, ev, re, r, rp, c, 0) then
......
...@@ -590,6 +590,11 @@ EFFECT_EXTRA_LEAVEFIELD_COUNT = 372 --增加额外退场数量 ...@@ -590,6 +590,11 @@ EFFECT_EXTRA_LEAVEFIELD_COUNT = 372 --增加额外退场数量
EFFECT_FLAG_EFFECT = 0x20000000 --标记类效果,即RegisterFlagEffect()创建的效果 EFFECT_FLAG_EFFECT = 0x20000000 --标记类效果,即RegisterFlagEffect()创建的效果
EFFECT_CANNOT_TO_EXILE = 0x688 ----不能除外 EFFECT_CANNOT_TO_EXILE = 0x688 ----不能除外
EFFECT_CHANGE_TRIGGER_STAR = 373
EFFECT_CHANGE_TRIGGER_ATK = 374
EFFECT_CHANGE_TRIGGER_RECOVER = 375
EFFECT_CHANGE_TRIGGER_DRAW = 376
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发) --下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP = 1000 --N/A EVENT_STARTUP = 1000 --N/A
EVENT_FLIP = 1001 --翻转时 EVENT_FLIP = 1001 --翻转时
......
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