67 lines
2.3 KiB
C#
67 lines
2.3 KiB
C#
|
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 float 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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|