【战斗】暂停时间增加默认值配表

main
刘涛 2024-09-24 12:49:44 +08:00
parent f6e0fab408
commit b9bd93c746
13 changed files with 49 additions and 39 deletions

View File

@ -77,7 +77,7 @@ namespace Gameplay.Character
_oldTimeScale = LevelManager.Instance.CurrentLevel.GetSpeed();
// 设置为1倍速
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Normal);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
readyPauseEnd = false;
readySkillEnd = false;

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gameplay.Common
namespace Gameplay.Common
{
public static class CodeDefine
{
@ -14,7 +8,7 @@ namespace Gameplay.Common
public const int HOLD_FLAG_BUFF_ID = 7;
public const int BLEED_BUFF_ID = 8;
public static bool ENABLE_FIGHT_NORMAL_ATTACK_LOG = false;
}
}

View File

@ -5,10 +5,12 @@ namespace Gameplay.Level
{
public static class ELevelSpeed
{
public static float Normal = 1f;
public static float Fast = 2f;
public static float Slow = 0f;
public static float SuperFast = 4f;
public static float Level_0 = 0f;
public static float Level_1 = 1f;
public static float Level_2 = 2f;
public static float Level_3 = 4f;
public static float DEFAULT_SPEED = 1F;
}
@ -16,7 +18,7 @@ namespace Gameplay.Level
{
private bool _isPause = false;
private float _speed = ELevelSpeed.Normal;
private float _speed = ELevelSpeed.Level_1;
public void SetPause(bool pause)
{

View File

@ -277,10 +277,12 @@ namespace Gameplay.Level
public void Init()
{
// 初始化速度
ELevelSpeed.Slow = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[0];
ELevelSpeed.Normal = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[1];
ELevelSpeed.Fast = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[2];
ELevelSpeed.SuperFast = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[3];
ELevelSpeed.Level_0 = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[0];
ELevelSpeed.Level_1 = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[1];
ELevelSpeed.Level_2 = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[2];
ELevelSpeed.Level_3 = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[3];
var defaultLevelSpeedIndex = TableManager.Instance.Tables.GlobalConfig.FightSpeedDefault;
ELevelSpeed.DEFAULT_SPEED = TableManager.Instance.Tables.GlobalConfig.FightSpeedParams[defaultLevelSpeedIndex];
AIManager.Instance.Init();

View File

@ -75,7 +75,7 @@ namespace Gameplay.Level
CameraManager.Instance.MainCamera.GetComponent<CameraController>().AdjustSelf();
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Normal);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
}
protected override void _OnUpdate(float deltaTime)

View File

@ -307,11 +307,11 @@ namespace Gameplay.Pause
{
if (AreaManager.instance.isInSelecting)
{
globalScale = ELevelSpeed.Slow;
globalScale = ELevelSpeed.Level_0;
}
else if (SkillManager.instance.needSkillPaused)
{
globalScale = ELevelSpeed.Normal;
globalScale = ELevelSpeed.Level_1;
}
for (var i = 0; i < _animList.Count; ++i)
{

View File

@ -79,11 +79,11 @@ public class UIFightClockController : UIWindow{
Text_PutUnitDown = GetComponent<TMP_Text>("Image_TopBG/Text_PutUnitDown");
BindButton(Button_SpeedPause, OnClickPause);
BindButton(Button_SpeedHalfX, OnClickSpeedBtn, ELevelSpeed.Slow);
BindButton(Button_Speed1X, OnClickSpeedBtn, ELevelSpeed.Normal);
BindButton(Button_Speed2X, OnClickSpeedBtn, ELevelSpeed.Fast);
BindButton(Button_Speed4X, OnClickSpeedBtn, ELevelSpeed.SuperFast);
BindButton(Button_Speed1XNormalBlack, OnClickSpeedBtn, ELevelSpeed.Normal);
BindButton(Button_SpeedHalfX, OnClickSpeedBtn, ELevelSpeed.Level_0);
BindButton(Button_Speed1X, OnClickSpeedBtn, ELevelSpeed.Level_1);
BindButton(Button_Speed2X, OnClickSpeedBtn, ELevelSpeed.Level_2);
BindButton(Button_Speed4X, OnClickSpeedBtn, ELevelSpeed.Level_3);
BindButton(Button_Speed1XNormalBlack, OnClickSpeedBtn, ELevelSpeed.Level_1);
BindButton(Button_RotateNormalBG, AutoFight, true);
BindButton(Button_RotateRotatingBG, AutoFight, false);
@ -308,7 +308,7 @@ public class UIFightClockController : UIWindow{
private void RefreshSpeed()
{
float curSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
if (Math.Abs(curSpeed - ELevelSpeed.Slow) < 0.01f)
if (Math.Abs(curSpeed - ELevelSpeed.Level_0) < 0.01f)
{
GameObj_UI1X.SetActive(false);
GameObj_UI05X.SetActive(true);
@ -322,15 +322,15 @@ public class UIFightClockController : UIWindow{
void SetButtonImgs(float speed)
{
SetButtonSelected(Button_Speed1X, ELevelSpeed.Normal);
SetButtonSelected(Button_Speed2X, ELevelSpeed.Fast);
SetButtonSelected(Button_Speed4X, ELevelSpeed.SuperFast);
SetButtonSelected(Button_Speed1X, ELevelSpeed.Level_1);
SetButtonSelected(Button_Speed2X, ELevelSpeed.Level_2);
SetButtonSelected(Button_Speed4X, ELevelSpeed.Level_3);
}
async void SetButtonSelected(Button button, float speed)
{
float curSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
if (speed >= ELevelSpeed.Normal)
if (speed >= ELevelSpeed.Level_1)
{
speed = Convert.ToInt32(speed);
}

View File

@ -1242,7 +1242,7 @@ public class UITeamFightController : UIWindow
{
_originalSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
}
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Slow);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
}
if (!TeamManager.IsHideAllUI)
@ -1615,7 +1615,7 @@ public class UITeamFightController : UIWindow
{
_originalSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
}
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Slow);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
}
AreaManager.instance.readyAreaManager.ShowReadyArea();
@ -1798,7 +1798,7 @@ public class UITeamFightController : UIWindow
{
_originalSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
}
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Slow);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
GameUnit unit = GameUnitManager.instance.infightUnits.Search(uid);
SetSkillPutState(SkillPutState.Dragging);

View File

@ -464,7 +464,7 @@ namespace Gameplay.Unit
realDamage = 1;
}
if (DebugUtil.LogEnable)
if (CodeDefine.ENABLE_FIGHT_NORMAL_ATTACK_LOG)
{
DebugUtil.Log($"{sender.GetDescString()} 对 {GetDescString()} 造成了 {damage} 伤害 实际伤害为 {realDamage} 是否暴击 {isCritical} 是否无视护盾 {isignoreShield}");
}

View File

@ -69,7 +69,7 @@ namespace Gameplay.Vehicle.State
base._OnEnter(exitState, param);
_oldSpeed = LevelManager.Instance.CurrentLevel.GetSpeed();
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Normal);
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
readyPauseEnd = false;
readySkillEnd = false;

View File

@ -79,11 +79,12 @@ public sealed partial class DataGlobalConfig : Bright.Config.BeanBase
{ if(!_json["PvpWeekScheduleID"].IsNumber) { throw new SerializationException(); } PvpWeekScheduleID = _json["PvpWeekScheduleID"]; }
{ if(!_json["PvpMonthScheduleID"].IsNumber) { throw new SerializationException(); } PvpMonthScheduleID = _json["PvpMonthScheduleID"]; }
{ var __json0 = _json["FightSpeedParams"]; if(!__json0.IsArray) { throw new SerializationException(); } FightSpeedParams = new System.Collections.Generic.List<float>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { float __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } FightSpeedParams.Add(__v0); } }
{ if(!_json["FightSpeedDefault"].IsNumber) { throw new SerializationException(); } FightSpeedDefault = _json["FightSpeedDefault"]; }
{ if(!_json["PvpFightBuildLimit"].IsNumber) { throw new SerializationException(); } PvpFightBuildLimit = _json["PvpFightBuildLimit"]; }
PostInit();
}
public DataGlobalConfig(int Hero_Exp_Item, int Item_Max_Default, int DailyChangeHour, System.Collections.Generic.List<int> SuppressBuffIds, System.Collections.Generic.List<int> RetreatBuffIds, float FP_n, float FP_K, System.Collections.Generic.List<int> DefaultTeamIDs, int DefaultTeamIcon, string DefaultTeamName, System.Collections.Generic.List<int> DefaultPlayerSKill, int MaxTeamCount, int EnergyPointID, int EnergyPointRecoverTime, int GroundFireEffectId, int DiamondItemId, int GoldItemId, int MailDays, int MaxMailCount, string HeadPicFrontPath, int PVPLevelID, int NextPVPLevelID, float PvpScoreOffset, int PvpScoreBase, int PvpScoreUp, int PvpScoreDown, int PvpScoreFailed, int PvpScoreDefence, int PvpPageCount, item.ItemCounts PvpCost, int TaskUpdateCountFrame, int MailID_DailyTaskReward, int MailID_WeeklyTaskReward, int SaoDangTicket, float ForceEscapeTime, System.Collections.Generic.List<int> PlayerSkillUpgradeUnLockTotalLevel, int MailID_ItemMaxCount, int PvpCoinId, int PieceExchangeId, int OutOfCombatMoraleRecoverRate, string PvpRobotName, System.Collections.Generic.List<int> PvpDefendCellList, int PvpBattleWinRewards, int PvpBattleLoseRewards, int PvpDefenderMaxNumber, int PvpRankingMinNumber, System.Collections.Generic.List<int> StaminaTypeItem, int DEFAULT_SKIN_ID, float StoryDialogueWaitTime, int BattleFailedTipsNumber, System.Collections.Generic.List<int> UnderEighteenGameWeekDay, int UnderEighteenGameHour, float BattleVoiceTriggerTime, System.Collections.Generic.List<float> CampaignScoreClass, System.Collections.Generic.List<int> OverflowCharacterChipExchange, float SkillCameraRotateTime, float SkillCameraFadeInTime, float SkillCameraFadeOutTime, int PvpWeekScheduleID, int PvpMonthScheduleID, System.Collections.Generic.List<float> FightSpeedParams, int PvpFightBuildLimit )
public DataGlobalConfig(int Hero_Exp_Item, int Item_Max_Default, int DailyChangeHour, System.Collections.Generic.List<int> SuppressBuffIds, System.Collections.Generic.List<int> RetreatBuffIds, float FP_n, float FP_K, System.Collections.Generic.List<int> DefaultTeamIDs, int DefaultTeamIcon, string DefaultTeamName, System.Collections.Generic.List<int> DefaultPlayerSKill, int MaxTeamCount, int EnergyPointID, int EnergyPointRecoverTime, int GroundFireEffectId, int DiamondItemId, int GoldItemId, int MailDays, int MaxMailCount, string HeadPicFrontPath, int PVPLevelID, int NextPVPLevelID, float PvpScoreOffset, int PvpScoreBase, int PvpScoreUp, int PvpScoreDown, int PvpScoreFailed, int PvpScoreDefence, int PvpPageCount, item.ItemCounts PvpCost, int TaskUpdateCountFrame, int MailID_DailyTaskReward, int MailID_WeeklyTaskReward, int SaoDangTicket, float ForceEscapeTime, System.Collections.Generic.List<int> PlayerSkillUpgradeUnLockTotalLevel, int MailID_ItemMaxCount, int PvpCoinId, int PieceExchangeId, int OutOfCombatMoraleRecoverRate, string PvpRobotName, System.Collections.Generic.List<int> PvpDefendCellList, int PvpBattleWinRewards, int PvpBattleLoseRewards, int PvpDefenderMaxNumber, int PvpRankingMinNumber, System.Collections.Generic.List<int> StaminaTypeItem, int DEFAULT_SKIN_ID, float StoryDialogueWaitTime, int BattleFailedTipsNumber, System.Collections.Generic.List<int> UnderEighteenGameWeekDay, int UnderEighteenGameHour, float BattleVoiceTriggerTime, System.Collections.Generic.List<float> CampaignScoreClass, System.Collections.Generic.List<int> OverflowCharacterChipExchange, float SkillCameraRotateTime, float SkillCameraFadeInTime, float SkillCameraFadeOutTime, int PvpWeekScheduleID, int PvpMonthScheduleID, System.Collections.Generic.List<float> FightSpeedParams, int FightSpeedDefault, int PvpFightBuildLimit )
{
this.HeroExpItem = Hero_Exp_Item;
this.ItemMaxDefault = Item_Max_Default;
@ -146,6 +147,7 @@ public sealed partial class DataGlobalConfig : Bright.Config.BeanBase
this.PvpWeekScheduleID = PvpWeekScheduleID;
this.PvpMonthScheduleID = PvpMonthScheduleID;
this.FightSpeedParams = FightSpeedParams;
this.FightSpeedDefault = FightSpeedDefault;
this.PvpFightBuildLimit = PvpFightBuildLimit;
PostInit();
}
@ -390,10 +392,14 @@ public sealed partial class DataGlobalConfig : Bright.Config.BeanBase
public int PvpWeekScheduleID { get; private set; }
public int PvpMonthScheduleID { get; private set; }
/// <summary>
/// 战斗内时间缩放参数,必须为四个,默认为 第二个
/// 战斗内时间缩放参数,必须为四个
/// </summary>
public System.Collections.Generic.List<float> FightSpeedParams { get; private set; }
/// <summary>
/// 战斗内默认速度index
/// </summary>
public int FightSpeedDefault { get; private set; }
/// <summary>
/// PVP建筑防守可上阵数量限制
/// </summary>
public int PvpFightBuildLimit { get; private set; }
@ -476,6 +482,7 @@ public sealed partial class DataGlobalConfig : Bright.Config.BeanBase
+ "PvpWeekScheduleID:" + PvpWeekScheduleID + ","
+ "PvpMonthScheduleID:" + PvpMonthScheduleID + ","
+ "FightSpeedParams:" + Bright.Common.StringUtil.CollectionToString(FightSpeedParams) + ","
+ "FightSpeedDefault:" + FightSpeedDefault + ","
+ "PvpFightBuildLimit:" + PvpFightBuildLimit + ","
+ "}";
}

View File

@ -265,10 +265,14 @@ public sealed partial class GlobalConfig
public int PvpWeekScheduleID => _data.PvpWeekScheduleID;
public int PvpMonthScheduleID => _data.PvpMonthScheduleID;
/// <summary>
/// 战斗内时间缩放参数,必须为四个,默认为 第二个
/// 战斗内时间缩放参数,必须为四个
/// </summary>
public System.Collections.Generic.List<float> FightSpeedParams => _data.FightSpeedParams;
/// <summary>
/// 战斗内默认速度index
/// </summary>
public int FightSpeedDefault => _data.FightSpeedDefault;
/// <summary>
/// PVP建筑防守可上阵数量限制
/// </summary>
public int PvpFightBuildLimit => _data.PvpFightBuildLimit;

View File

@ -114,6 +114,7 @@
1,
4
],
"FightSpeedDefault": 2,
"PvpFightBuildLimit": 3
}
]