2023-11-28 15:35:13 +08:00
|
|
|
|
using cfg.VihecleCultivateCfg;
|
|
|
|
|
|
using Framework;
|
2023-12-05 12:49:29 +08:00
|
|
|
|
using Gameplay;
|
2023-12-14 14:42:27 +08:00
|
|
|
|
using Gameplay.Vehicle.Data;
|
2023-11-17 15:52:44 +08:00
|
|
|
|
|
|
|
|
|
|
public static class VehicleDataHelper
|
|
|
|
|
|
{
|
2023-12-01 13:35:33 +08:00
|
|
|
|
public const int NotAdapt = 0;
|
|
|
|
|
|
public const int Adapt = 1;
|
|
|
|
|
|
public const int VeryAdapt = 2;
|
2023-11-17 15:59:39 +08:00
|
|
|
|
public static int GetVehicleSkillId(int vehicleId)
|
2023-11-17 15:52:44 +08:00
|
|
|
|
{
|
2023-11-17 15:59:39 +08:00
|
|
|
|
VehicleCultivateData vehicleInfo = VehicleCultivateDataManager.Instance.GetVehicleCultivateData((uint)vehicleId);
|
2023-11-17 15:52:44 +08:00
|
|
|
|
int skillLv = (int)vehicleInfo.SumBonus(cfg.VihecleCultivateCfg.BonusType.SkillLv);
|
|
|
|
|
|
var skillLevelInfo = TableManager.Instance.Tables.CharacterSkillLevel.Get(vehicleInfo.Cfg.ID, skillLv);
|
|
|
|
|
|
if(skillLevelInfo==null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("载具id为{0}技能等级为{1}的表没配",vehicleInfo.Cfg.ID,skillLv);
|
|
|
|
|
|
return TableManager.Instance.Tables.CharacterSkillLevel.DataList[0].SkillGroupId;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return skillLevelInfo.SkillGroupId;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2023-11-28 15:35:13 +08:00
|
|
|
|
public static BonusType GetBonusTypeByTerrainID(int terrainId)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (terrainId)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
return BonusType.TerrainPlain;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
return BonusType.TerrainMountain;
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
return BonusType.TerrainForest;
|
|
|
|
|
|
case 5:
|
|
|
|
|
|
return BonusType.TerrainSnow;
|
|
|
|
|
|
}
|
|
|
|
|
|
DebugUtil.LogError("因为VehicleBonusType暂时不需要其他地形类型,所以妹写");
|
|
|
|
|
|
return BonusType.TerrainPlain;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2023-12-01 13:35:33 +08:00
|
|
|
|
public static string GetTerrainAdaptStr(int terrainAdaptVal)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (terrainAdaptVal)
|
|
|
|
|
|
{
|
|
|
|
|
|
case NotAdapt:
|
2023-12-05 12:49:29 +08:00
|
|
|
|
return CommonUtils. GetLocalizeText("vehicleCultivate_NotAdapt");
|
2023-12-01 13:35:33 +08:00
|
|
|
|
case Adapt:
|
2023-12-05 12:49:29 +08:00
|
|
|
|
return CommonUtils.GetLocalizeText("vehicleCultivate_Adapt");
|
2023-12-01 13:35:33 +08:00
|
|
|
|
case VeryAdapt:
|
2023-12-05 12:49:29 +08:00
|
|
|
|
return CommonUtils.GetLocalizeText("vehicleCultivate_TeHua");
|
2023-12-01 13:35:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
DebugUtil.LogError("载具的地形适应配置错了:载具upbonus表");
|
|
|
|
|
|
return "拉取中";
|
|
|
|
|
|
}
|
|
|
|
|
|
public static string GetVehiclePicPath(int iD)
|
|
|
|
|
|
{
|
|
|
|
|
|
string str = TableManager.Instance.Tables.VehicleConfig.GetOrDefault(iD).Icon;
|
|
|
|
|
|
return Constants.UI_Vehicle_IconPath+str+".png";
|
|
|
|
|
|
}
|
2023-12-14 14:42:27 +08:00
|
|
|
|
|
|
|
|
|
|
public static VehicleConfigData CombineConfigData(VehicleCultivateData infoData)
|
|
|
|
|
|
{
|
|
|
|
|
|
var rawConfig = infoData.Cfg;
|
|
|
|
|
|
// 临时写死
|
|
|
|
|
|
var level = 1;
|
|
|
|
|
|
var skillLevel = 1;
|
|
|
|
|
|
var configData = new VehicleConfigData();
|
|
|
|
|
|
configData.Init(rawConfig, level, skillLevel);
|
|
|
|
|
|
return configData;
|
|
|
|
|
|
}
|
2023-12-01 13:35:33 +08:00
|
|
|
|
|
2023-11-17 15:52:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|