CTT/Server/Hotfix/Game/Helper/SkillHotfixHelper.cs

67 lines
2.3 KiB
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using Cal;
using Cal.DataTable;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace ET
{
public class SkillHotfixHelper
{
public static int GetOverlableBuffMaxLayer(OverlableBuffType overlableBuffType) => overlableBuffType switch
{
OverlableBuffType. => 8,
OverlableBuffType. => 6,
OverlableBuffType. => 4,
OverlableBuffType. => 8,
_ =>throw new Exception($"类型错误:{overlableBuffType}"),
};
public static int GetThinkerInterval(ThinkerType thinkerType) => thinkerType switch
{
ThinkerType. => 3500,
ThinkerType. => 5500,
ThinkerType. => 5000,
ThinkerType. => 4000,
_ => throw new Exception($"类型错误:{thinkerType}"),
};
public static int GetNomalSkillId(Unit unit)
{
if(unit.UnitType == UnitType.Player)
{
int jobId = UserComponent.Instance.Get(unit.Id).JobId;
switch (JobHelper.GetJobType(jobId))
{
default:
case JobType.UnKnown:
return 100001;
case JobType.Officer:
return 100001;
case JobType.Sportsman:
return 200001;
case JobType.Nurse:
return 300001;
case JobType.Superman:
return 400001;
}
}
return 100001;
}
public static int RandomNumber(int skillId, SkillParam minCount, SkillParam maxCount, bool isRnadom = true)
{
2021-04-11 19:50:39 +08:00
if (!SkillHelper.GetParam(maxCount, skillId, out float max))
2021-04-08 20:09:59 +08:00
{
Log.Error($"数据填写不完整the id of skill is {skillId}");
return 1;
}
float min = 1;
if (isRnadom && !SkillHelper.GetParam(minCount, skillId, out min))
{
Log.Error($"数据填写不完整the id of skill is {skillId}");
}
return isRnadom ? RandomHelper.RandomNumber((int)min, (int)max + 1) : (int)max;
}
}
}