-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CN UPDATE] Client:2.2.61 Data:24-05-13-13-28-58-962413
- Loading branch information
MuelsyseBot_v1
committed
May 15, 2024
1 parent
65726b5
commit 3a73ee8
Showing
61 changed files
with
203,021 additions
and
473 deletions.
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
zh_CN/gamedata/[uc]lua/hotfixes/Act2VMultiBattleFinishNormalViewHotfixer.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
local Act2VMultiBattleFinishNormalViewHotfixer = Class("Act2VMultiBattleFinishNormalViewHotfixer", HotfixBase) | ||
|
||
local function GetMileStoneSeqFix(self) | ||
local ret = CS.DG.Tweening.DOTween.Sequence() | ||
if self.m_cachedViewModel == nil then | ||
return nil | ||
end | ||
if self.m_cachedViewModel.mileStoneFrom == nil or self.m_cachedViewModel.mileStoneTo == nil then | ||
return nil | ||
end | ||
local haveSeq = false | ||
if self.m_cachedViewModel.completeDaily then | ||
self._dailyAnim.animationWrapper:InitIfNot() | ||
self._dailyAnim.animationWrapper:SampleClipAtBegin(self._dailyAnim.animationName) | ||
local dailyTween = self._dailyAnim.animationWrapper:PlayWithTween(self._dailyAnim.animationName) | ||
ret:Insert(0, dailyTween) | ||
haveSeq = true | ||
end | ||
local mileStoneSeq = CS.DG.Tweening.DOTween.Sequence() | ||
local mileStoneFrom = self.m_cachedViewModel.mileStoneFrom | ||
local mileStoneTo = self.m_cachedViewModel.mileStoneTo | ||
self._mileStoneLv.text = tostring(mileStoneFrom.currentLv) | ||
self._mileStoneProgress.value = mileStoneFrom.expPercentage | ||
local fromLv = mileStoneFrom.currentLv | ||
local toLv = mileStoneTo.currentLv | ||
local fromPercent = mileStoneFrom.expPercentage | ||
local toPercent = mileStoneTo.expPercentage | ||
if fromLv == toLv then | ||
local duration = (toPercent - fromPercent) * self._mileStoneDuration; | ||
if not CS.Torappu.MathUtil.GE(duration, 0.0) then | ||
duration = 0 | ||
end | ||
local oneTween = CS.DG.Tweening.DOTween:To( | ||
function() | ||
return fromPercent | ||
end, | ||
function(val) | ||
self._mileStoneProgress.value = val | ||
end, toPercent, duration) | ||
mileStoneSeq:Append(oneTween) | ||
haveSeq = true | ||
else | ||
if fromLv < toLv then | ||
local frontDuration = (1 - fromPercent) * self._mileStoneDuration | ||
if not CS.Torappu.MathUtil.GE(frontDuration, 0.0) then | ||
frontDuration = 0 | ||
end | ||
local frontTween = CS.DG.Tweening.DOTween.To( | ||
function() | ||
return fromPercent | ||
end, | ||
function(val) | ||
self._mileStoneProgress.value = val | ||
end, 1, frontDuration):OnComplete( | ||
function() | ||
self._mileStoneLv.text = tostring(fromLv + 1) | ||
self:_PlayLvUpTween() | ||
end) | ||
mileStoneSeq:Append(frontTween) | ||
local loopTweenIndex = 0 | ||
while loopTweenIndex < toLv - fromLv - 1 do | ||
local midDuration = self._mileStoneDuration | ||
local toLevelNum = fromLv + loopTweenIndex + 2 | ||
if not CS.Torappu.MathUtil.GE(midDuration, 0.0) then | ||
midDuration = 0 | ||
end | ||
local loopTween = CS.DG.Tweening.DOTween.To( | ||
function() | ||
return 0 | ||
end, | ||
function(val) | ||
self._mileStoneProgress.value = val | ||
end, 1, midDuration):OnComplete( | ||
function() | ||
self._mileStoneLv.text = tostring(toLevelNum) | ||
self:_PlayLvUpTween() | ||
end) | ||
mileStoneSeq:Append(loopTween) | ||
loopTweenIndex = loopTweenIndex + 1 | ||
end | ||
local lastDuration = toPercent * self._mileStoneDuration | ||
if not CS.Torappu.MathUtil.GE(lastDuration, 0.0) then | ||
lastDuration = 0 | ||
end | ||
local lastTween = CS.DG.Tweening.DOTween.To( | ||
function() | ||
return 0 | ||
end, | ||
function(val) | ||
self._mileStoneProgress.value = val | ||
end, toPercent, lastDuration) | ||
mileStoneSeq:Append(lastTween) | ||
haveSeq = true | ||
end | ||
end | ||
ret:Insert(0, mileStoneSeq) | ||
if not haveSeq then | ||
return nil | ||
end | ||
return ret | ||
end | ||
|
||
function Act2VMultiBattleFinishNormalViewHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Activity.Act2VMulti.Act2VMultiBattleFinishNormalView) | ||
self:Fix_ex(CS.Torappu.Activity.Act2VMulti.Act2VMultiBattleFinishNormalView, "_GetMileStoneSeq", function(self) | ||
local ok, errorInfo = xpcall(GetMileStoneSeqFix, debug.traceback, self) | ||
if not ok then | ||
LogError("[Act2VMultiBattleFinishNormalViewHotfixer] fix" .. errorInfo) | ||
else | ||
return errorInfo | ||
end | ||
end) | ||
end | ||
|
||
function Act2VMultiBattleFinishNormalViewHotfixer:OnDispose() | ||
end | ||
|
||
return Act2VMultiBattleFinishNormalViewHotfixer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
local BattlePhaseHotfixer = Class("BattlePhaseHotfixer", HotfixBase) | ||
local eutil = CS.Torappu.Lua.Util | ||
|
||
function _PreserveToFix(self, frameCount) | ||
if self.m_leftFrameInStepInFast > 0 then | ||
while self.m_leftFrameInStepInFast >= 1 do | ||
self.m_gameMode:NextFrame() | ||
self.m_leftFrameInStepInFast = self.m_leftFrameInStepInFast - 1 | ||
self.m_playFramesOnce = self.m_playFramesOnce - 1 | ||
end | ||
end | ||
if frameCount < 0 then | ||
self.m_preserveCnt = 0 | ||
else | ||
self.m_preserveCnt = frameCount | ||
end | ||
end | ||
|
||
function BattlePhaseHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Multiplayer.BattlePhase) | ||
|
||
self:Fix_ex(CS.Torappu.Multiplayer.BattlePhase, "_PreserveTo", function(self, frameCount) | ||
local ok, errorInfo = xpcall(_PreserveToFix, debug.traceback, self, frameCount) | ||
if not ok then | ||
eutil.LogError("[BattlePhaseHotfixer] BattlePhase fix" .. errorInfo) | ||
end | ||
end) | ||
end | ||
|
||
function BattlePhaseHotfixer:OnDispose() | ||
end | ||
|
||
return BattlePhaseHotfixer |
40 changes: 40 additions & 0 deletions
40
zh_CN/gamedata/[uc]lua/hotfixes/CooperateGameModeHotfixer.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
local CooperateGameModeHotfixer = Class("CooperateGameModeHotfixer", HotfixBase) | ||
local eutil = CS.Torappu.Lua.Util | ||
|
||
function _HardSetPlayerSpeedFix(self, side, speedOn) | ||
self:_HardSetPlayerSpeed(side, speedOn) | ||
local sideInt = 0 | ||
if side == CS.Torappu.PlayerSide.SIDE_A then | ||
sideInt = 1 | ||
else | ||
sideInt = 2 | ||
end | ||
|
||
if self.isResting and speedOn then | ||
local mask = 1 << sideInt | ||
self.m_playerSkipRestingMask = self.m_playerSkipRestingMask | mask | ||
self.m_cooperateUIPlugin:OnPlayerSkipResting(side) | ||
local checkMaskA = 1 << 1 | ||
local checkMaskB = 1 << 2 | ||
checkMaskB = checkMaskB | checkMaskA | ||
if self.m_playerSkipRestingMask == checkMaskB then | ||
self:OnRestingFinished() | ||
end | ||
end | ||
end | ||
|
||
function CooperateGameModeHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Battle.GameMode.GameModeFactory.CooperateGameMode) | ||
self:Fix_ex(CS.Torappu.Battle.GameMode.GameModeFactory.CooperateGameMode, "_HardSetPlayerSpeed", function(self, side, speedOn) | ||
local ok, errorInfo = xpcall(_HardSetPlayerSpeedFix, debug.traceback, self, side, speedOn) | ||
if not ok then | ||
eutil.LogError("[CooperateGameModeHotfixer] _HardSetPlayerSpeed fix" .. errorInfo) | ||
end | ||
end) | ||
end | ||
|
||
function CooperateGameModeHotfixer:OnDispose() | ||
end | ||
|
||
return CooperateGameModeHotfixer |
27 changes: 27 additions & 0 deletions
27
zh_CN/gamedata/[uc]lua/hotfixes/CooperateHintPanelHotfixer.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
local CooperateHintPanelHotfixer = Class("CooperateHintPanelHotfixer", HotfixBase) | ||
local eutil = CS.Torappu.Lua.Util | ||
|
||
function UpdateFix(self) | ||
self:Update() | ||
if self.m_gameMode.isResting then | ||
self._hintRect.anchoredPosition = self.m_fixPos | ||
else | ||
self._hintRect.anchoredPosition = self.m_originPos | ||
end | ||
end | ||
|
||
function CooperateHintPanelHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Activity.Cooperate.Battle.UI.CoopereteHintPanel) | ||
self:Fix_ex(CS.Torappu.Activity.Cooperate.Battle.UI.CoopereteHintPanel, "Update", function(self) | ||
local ok, errorInfo = xpcall(UpdateFix, debug.traceback, self) | ||
if not ok then | ||
eutil.LogError("[CooperateHintPanelHotfixer] Update fix" .. errorInfo) | ||
end | ||
end) | ||
end | ||
|
||
function CooperateHintPanelHotfixer:OnDispose() | ||
end | ||
|
||
return CooperateHintPanelHotfixer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
local EnemyHotfixer = Class("EnemyHotfixer", HotfixBase) | ||
local eutil = CS.Torappu.Lua.Util | ||
|
||
function EndPullFix(self, source) | ||
pullList = self.m_pullSources:GetInternalList() | ||
for i = 0, pullList.Count - 1 do | ||
src = pullList[i] | ||
if src:Lock() == source then | ||
self.m_pullSources:Remove(src) | ||
break | ||
end | ||
end | ||
|
||
disablePullSrc = self.m_disabledPullSources:GetInternalList() | ||
for i = 0, disablePullSrc.Count - 1 do | ||
src = disablePullSrc[i] | ||
if src:Lock() == source then | ||
self.m_disabledPullSources:Remove(src) | ||
break | ||
end | ||
end | ||
|
||
if self.m_pullSources.isEmpty and self.isUnbalanced then | ||
self.rigidbody2D:Sleep() | ||
self.rigidbody2D:WakeUp() | ||
self.stateMachine:Tick(0) | ||
end | ||
if source:GetType() ~= typeof(CS.Torappu.Battle.Projectile) and source.source ~= nil then | ||
source.source.buffContainer:OnEndPulling(self); | ||
end | ||
end | ||
|
||
function EnemyHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Battle.Enemy) | ||
self:Fix_ex(CS.Torappu.Battle.Enemy, "EndPull", function(self, source) | ||
local ok, errorInfo = xpcall(EndPullFix, debug.traceback, self, source) | ||
if not ok then | ||
eutil.LogError("[EnemyHotfixer] EndPull fix" .. errorInfo) | ||
end | ||
end) | ||
end | ||
|
||
function EnemyHotfixer:OnDispose() | ||
end | ||
|
||
return EnemyHotfixer |
Oops, something went wrong.