protected override void DoEnter(D3Player Entity) { if (!inited) { Astronaut.Common.Serializer<Config> serializer = new Astronaut.Common.Serializer<Config>(); string subDir = "\\Scripts\\"; string workingDir = System.IO.Directory.GetCurrentDirectory(); try { CombatConfig = serializer.Load(workingDir + subDir + ConfigFileName); } catch { CombatConfig = new Config(); } meleeRange = CombatConfig.MeleeRange; inited = true; setPower(); } }
public CombatState() { if (!inited) { Astronaut.Common.Serializer<Config> serializer = new Astronaut.Common.Serializer<Config>(); string subDir = string.Format("\\Scripts\\{0}\\", D3Control.playerClass); string workingDir = System.IO.Directory.GetCurrentDirectory(); try { CombatConfig = serializer.Load(workingDir + subDir + ConfigFileName); } catch { CombatConfig = new Config(); } meleeRange = CombatConfig.MeleeRange; inited = true; HitAndRuntimer.ChangeDuration(CombatConfig.DHDefaultSettings.HitandRunTimer * 1000); } setPower(); checkThreadStatus(); }