NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Data/VehicleConfigData.cs

115 lines
3.0 KiB
C#
Raw Normal View History

2023-08-22 19:08:45 +08:00
using cfg.VehicleCfg;
2023-10-19 15:00:19 +08:00
using Framework;
using Gameplay.Utils;
2023-08-22 19:08:45 +08:00
namespace Gameplay.Vehicle.Data
{
public class VehicleConfigData
{
public int configId;
public int level;
public int attack;
public int defense;
public int hp;
public int shield;
public float moveSpeed;
public float turnSpeed;
public int attackDistance;
public int standLevel;
public int crossLevel;
public float batteryTurnSpeed;
public float shootCd;
public int maxBulletCount;
public int perShootCount;
public float reloadTime;
public int moraleAttack;
public float scaleForHuman;
public float scaleForVehicle;
public float criticalRate;
public float criticalDamageScale;
public float firstShootTime;
public int weaponId;
2023-10-19 15:00:19 +08:00
public int sitCount;
2024-01-11 13:33:30 +08:00
public string prefabPath;
2023-08-22 19:08:45 +08:00
2023-10-19 15:00:19 +08:00
public int tireMarkId;
public int skillId;
2024-01-11 13:33:30 +08:00
2024-01-31 13:20:19 +08:00
public void Init(VehicleCultivateData rawConfig,
2023-10-19 15:00:19 +08:00
int level, int skillLevel)
2023-08-22 19:08:45 +08:00
{
2024-01-31 13:20:19 +08:00
configId = rawConfig.Cfg.ID;
prefabPath = PathEx.GetVehicleGameModelPath(configId);
2023-08-22 19:08:45 +08:00
this.level = level;
var levelIndex = level - 1;
2024-01-31 13:20:19 +08:00
attack = rawConfig.Attack();
defense = rawConfig.Defense();
hp = rawConfig.Hp();
shield = 0;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
moveSpeed = rawConfig.Cfg.MoveSpeed;
turnSpeed = rawConfig.Cfg.TurnSpeed;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
crossLevel = rawConfig.Cfg.MoveCrossLevel;
standLevel = rawConfig.Cfg.StandCrossLevel;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
attackDistance = rawConfig.Cfg.AttackDistance;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
batteryTurnSpeed = rawConfig.Cfg.BatteryTurnSpeed;
shootCd = 1f / rawConfig.Cfg.FireRate;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
maxBulletCount = rawConfig.Cfg.BulletCount;
perShootCount = rawConfig.Cfg.PerShootCount;
reloadTime = rawConfig.Cfg.ReloadTime;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
moraleAttack = rawConfig.Cfg.MoraleDamage;
criticalRate = rawConfig.Cfg.CriticalRate;
criticalDamageScale = rawConfig.Cfg.CriticalScale;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
firstShootTime = rawConfig.Cfg.FirstShootTime;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
sitCount = rawConfig.Cfg.SeatCount;
2023-10-19 15:00:19 +08:00
2024-01-31 13:20:19 +08:00
weaponId = rawConfig.Cfg.WeaponId;
2023-08-22 19:08:45 +08:00
2024-01-31 13:20:19 +08:00
tireMarkId = rawConfig.Cfg.TireMarkId;
2023-10-19 15:00:19 +08:00
2024-01-31 13:20:19 +08:00
var skillConfig = TableManager.Instance.Tables.VehicleSkllUpgrade.Get(rawConfig.Cfg.ID);
2024-01-25 12:51:19 +08:00
if (skillConfig == null)
{
2024-01-31 13:20:19 +08:00
DebugUtil.LogError($"未找到车辆技能配置:{rawConfig.Cfg.ID}");
2024-01-25 12:51:19 +08:00
skillId = -1;
}
else
{
var skillLevelIndex = skillLevel - 1;
skillId = skillConfig.SkillIdList[skillLevelIndex];
}
2023-10-19 15:00:19 +08:00
// TODO: 强制指定技能id
2024-01-17 14:31:53 +08:00
// skillId = 30009;
2023-08-22 19:08:45 +08:00
}
}
}