Commit e11b683d authored by 未闻皂名's avatar 未闻皂名

2023/3/17 修复极大怪兽作为解放时的攻击力计算问题

parent d180be66
...@@ -136,3 +136,14 @@ function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_p ...@@ -136,3 +136,14 @@ function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_p
end end
return og, ct return og, ct
end end
-- 获取被上级召唤解放时的基础攻击力
function RushDuel.GetBaseAttackOnTribute(c)
local atk
if RushDuel.IsMaximumMode(c) then
atk = c.maximum_attack
else
atk = c:GetTextAttack()
end
return math.max(0, atk)
end
...@@ -35,6 +35,14 @@ end ...@@ -35,6 +35,14 @@ end
-- 添加极大召唤手续 -- 添加极大召唤手续
function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code) function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
if c:IsStatus(STATUS_COPYING_EFFECT) then
return
end
-- 记录状态
if c.maximum_attack == nil then
local mt = getmetatable(c)
mt.maximum_attack = max_atk
end
-- 极大召唤 手续 -- 极大召唤 手续
RushDuel.AddHandSpecialSummonProcedure(c, aux.Stringid(120000000, 0), RushDuel.MaximumSummonCondition(left_code, right_code), RushDuel.MaximumSummonTarget(left_code, right_code), RushDuel.AddHandSpecialSummonProcedure(c, aux.Stringid(120000000, 0), RushDuel.MaximumSummonCondition(left_code, right_code), RushDuel.MaximumSummonTarget(left_code, right_code),
RushDuel.MaximumSummonOperation(left_code, right_code), RushDuel.MaximumSummonValue, POS_FACEUP_ATTACK) RushDuel.MaximumSummonOperation(left_code, right_code), RushDuel.MaximumSummonValue, POS_FACEUP_ATTACK)
...@@ -48,23 +56,23 @@ function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code) ...@@ -48,23 +56,23 @@ function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
e3:SetValue(max_atk) e3:SetValue(max_atk)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- 占用3个主要怪兽区域 -- 占用3个主要怪兽区域
local e8 = Effect.CreateEffect(c) local e4 = Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_MAX_MZONE) e4:SetCode(EFFECT_MAX_MZONE)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e8:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e8:SetTargetRange(1, 0) e4:SetTargetRange(1, 0)
e8:SetCondition(RushDuel.MaximumMode) e4:SetCondition(RushDuel.MaximumMode)
e8:SetValue(1) e4:SetValue(1)
c:RegisterEffect(e8) c:RegisterEffect(e4)
-- 离开场上时, 所有部件一同离开 -- 离开场上时, 所有部件一同离开
local e9 = Effect.CreateEffect(c) local e5 = Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P) e5:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e9:SetCondition(RushDuel.MaximumMode) e5:SetCondition(RushDuel.MaximumMode)
e9:SetOperation(RushDuel.MaximumLeaveOperation) e5:SetOperation(RushDuel.MaximumLeaveOperation)
c:RegisterEffect(e9) c:RegisterEffect(e5)
end end
function RushDuel.MaximumSummonFilter(c, e, tp, left_code, right_code) function RushDuel.MaximumSummonFilter(c, e, tp, left_code, right_code)
return c:IsCode(left_code, right_code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP) return c:IsCode(left_code, right_code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP)
......
...@@ -21,19 +21,15 @@ function cm.check(e,c) ...@@ -21,19 +21,15 @@ function cm.check(e,c)
local atk=0 local atk=0
local g=c:GetMaterial() local g=c:GetMaterial()
if g:GetCount()==1 then if g:GetCount()==1 then
atk=cm.getatk(g:GetFirst())*2 atk=RD.GetBaseAttackOnTribute(g:GetFirst())*2
elseif g:GetCount()==2 then elseif g:GetCount()==2 then
atk=cm.getatk(g:GetFirst())+cm.getatk(g:GetNext()) atk=RD.GetBaseAttackOnTribute(g:GetFirst())+RD.GetBaseAttackOnTribute(g:GetNext())
end end
if atk>0 and e:GetLabel()==1 then if atk>0 and e:GetLabel()==1 then
e:SetLabel(0) e:SetLabel(0)
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+0xff0000) RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+0xff0000)
end end
end end
function cm.getatk(c)
local atk=c:GetTextAttack()
if atk>0 then return atk else return 0 end
end
--Summon Only --Summon Only
function cm.facechk(e,tp,eg,ep,ev,re,r,rp) function cm.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1) e:GetLabelObject():SetLabel(1)
......
...@@ -20,7 +20,7 @@ end ...@@ -20,7 +20,7 @@ end
function cm.check(e,c) function cm.check(e,c)
local tc=c:GetMaterial():GetFirst() local tc=c:GetMaterial():GetFirst()
local atk=0 local atk=0
if tc then atk=tc:GetTextAttack()*2 end if tc then atk=RD.GetBaseAttackOnTribute(tc)*2 end
if atk>0 and e:GetLabel()==1 then if atk>0 and e:GetLabel()==1 then
e:SetLabel(0) e:SetLabel(0)
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+0xff0000) RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+0xff0000)
......
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