namespace Turbo.Plugins.LightningMod { using System.Linq; using System; public class DemonHunterSmokeScreenPlugin : AbstractSkillHandler, ISkillHandler { public DemonHunterSmokeScreenPlugin() : base(CastType.BuffSkill, CastPhase.AutoCast, CastPhase.Move, CastPhase.Attack, CastPhase.PreAttack) { Enabled = false; } public override void Load(IController hud) { base.Load(hud); AssignedSnoPower = Hud.Sno.SnoPowers.DemonHunter_SmokeScreen; CreateCastRule()//普通规则100码内有怪危险时施放 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfTrue(ctx => ctx.Skill.BuffIsActive).ThenNoCastElseContinue() .IfTrue(ctx => ctx.Hud.Avoidance.CurrentValue).ThenCastElseContinue() .IfTrue(ctx => ctx.Skill.Player.AvoidablesInRange.Any(x => x.AvoidableDefinition.InstantDeath)).ThenCastElseContinue() .IfEnoughMonstersNearby(ctx => 100, ctx => 1).ThenContinueElseNoCast() .IfHealthWarning(60, 80).ThenCastElseContinue(); CreateCastRule()//自动保持残影戒指BUFF .IfTrue(ctx => ctx.Skill.Player.Powers.UsedLegendaryPowers.ElusiveRing?.Active == true).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 40, ctx => 1).ThenContinueElseNoCast() .IfSpecificBuffIsAboutToExpire(hud.Sno.SnoPowers.ElusiveRing, 1, 100, 150).ThenCastElseContinue();//残影戒指Buff CreateCastRule()//恐惧6件套时40码遇怪且几率低于20时每2.5~3秒施放一次 .IfTrue(ctx => Hud.Game.Me.GetSetItemCount(791249) >= 6 && ctx.Skill.Player.Powers.UsedDemonHunterPowers.Preparation != null).ThenContinueElseNoCast()//恐惧6件套且装备蓄势待发 .IfSecondaryResourceAmountIsBelow(ctx => 20).ThenContinueElseNoCast()//戒律低于20点时使用该规则 .IfCanCastSkill(2500, 3000, 5000).ThenContinueElseNoCast()//每2.5~3秒施放一次 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 40, ctx => 1).ThenCastElseContinue() ; CreateCastRule()//恐惧6件套时40码遇怪且戒律高于20时施放 .IfTrue(ctx => Hud.Game.Me.GetSetItemCount(791249) >= 6 && ctx.Skill.Player.Powers.UsedDemonHunterPowers.Preparation != null).ThenContinueElseNoCast()//恐惧6件套且装备蓄势待发 .IfSecondaryResourceAmountIsAbove(ctx => 20).ThenContinueElseNoCast()//戒律高于20点时使用该规则 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 40, ctx => 1).ThenCastElseContinue() ; CreateCastRule()//恐惧6件套时40码遇怪就每2.5~3秒施放一次施放 .IfTrue(ctx => Hud.Game.Me.GetSetItemCount(791249) >= 6 && ctx.Skill.Player.Powers.UsedDemonHunterPowers.Preparation != null).ThenContinueElseNoCast()//恐惧6件套且装备蓄势待发 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfEliteOrBossIsNearby(ctx => 80).ThenCastElseContinue()//80码内有精英或BOSS时施放 ; CreateCastRule()//减耗高于40%且飘忽不定符文且移动时施放 .IfTrue(ctx => ctx.Skill.Rune == 4 && ctx.Skill.Player.Stats.ResourceCostReduction >= 0.4 && ctx.Skill.Player.Powers.UsedDemonHunterPowers.Preparation != null).ThenContinueElseNoCast()//飘忽不定符文且减耗大于40%且装备蓄势待发 .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfOnCooldown().ThenNoCastElseContinue() .IfCanCastBuff().ThenContinueElseNoCast() .IfCanCastSimple().ThenContinueElseNoCast() .IfSecondaryResourceIsEnough(0, ctx => 0).ThenContinueElseNoCast() .IfRunning().ThenCastElseContinue()//移动时施放 .IfEliteOrBossIsNearby(ctx => 80).ThenCastElseContinue()//80码内有精英或BOSS时施放 ; } } }