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

67 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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)
{
if (!SkillHelper.GetParam(maxCount, skillId, out var max))
{
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;
}
}
}