115 lines
3.0 KiB
C#
115 lines
3.0 KiB
C#
using cfg.VehicleCfg;
|
|
using Framework;
|
|
using Gameplay.Utils;
|
|
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;
|
|
|
|
public int sitCount;
|
|
|
|
public string prefabPath;
|
|
|
|
public int tireMarkId;
|
|
|
|
public int skillId;
|
|
|
|
public void Init(VehicleCultivateData rawConfig,
|
|
int level, int skillLevel)
|
|
{
|
|
configId = rawConfig.Cfg.ID;
|
|
prefabPath = PathEx.GetVehicleGameModelPath(configId);
|
|
|
|
this.level = level;
|
|
|
|
var levelIndex = level - 1;
|
|
attack = rawConfig.Attack();
|
|
defense = rawConfig.Defense();
|
|
hp = rawConfig.Hp();
|
|
shield = 0;
|
|
|
|
moveSpeed = rawConfig.Cfg.MoveSpeed;
|
|
turnSpeed = rawConfig.Cfg.TurnSpeed;
|
|
|
|
crossLevel = rawConfig.Cfg.MoveCrossLevel;
|
|
standLevel = rawConfig.Cfg.StandCrossLevel;
|
|
|
|
attackDistance = rawConfig.Cfg.AttackDistance;
|
|
|
|
batteryTurnSpeed = rawConfig.Cfg.BatteryTurnSpeed;
|
|
shootCd = 1f / rawConfig.Cfg.FireRate;
|
|
|
|
maxBulletCount = rawConfig.Cfg.BulletCount;
|
|
perShootCount = rawConfig.Cfg.PerShootCount;
|
|
reloadTime = rawConfig.Cfg.ReloadTime;
|
|
|
|
moraleAttack = rawConfig.Cfg.MoraleDamage;
|
|
criticalRate = rawConfig.Cfg.CriticalRate;
|
|
criticalDamageScale = rawConfig.Cfg.CriticalScale;
|
|
|
|
firstShootTime = rawConfig.Cfg.FirstShootTime;
|
|
|
|
sitCount = rawConfig.Cfg.SeatCount;
|
|
|
|
weaponId = rawConfig.Cfg.WeaponId;
|
|
|
|
tireMarkId = rawConfig.Cfg.TireMarkId;
|
|
|
|
var skillConfig = TableManager.Instance.Tables.VehicleSkllUpgrade.Get(rawConfig.Cfg.ID);
|
|
if (skillConfig == null)
|
|
{
|
|
DebugUtil.LogError($"未找到车辆技能配置:{rawConfig.Cfg.ID}");
|
|
skillId = -1;
|
|
}
|
|
else
|
|
{
|
|
var skillLevelIndex = skillLevel - 1;
|
|
skillId = skillConfig.SkillIdList[skillLevelIndex];
|
|
}
|
|
|
|
|
|
// TODO: 强制指定技能id
|
|
// skillId = 30009;
|
|
|
|
}
|
|
|
|
}
|
|
}
|