using System.Linq; namespace Turbo.Plugins.LightningMod { public class MonkCycloneStrikePlugin : AbstractSkillHandler, ISkillHandler { public MonkCycloneStrikePlugin() : base(CastType.SimpleSkill, CastPhase.AutoCast, CastPhase.Attack) { Enabled = false; } public override void Load(IController hud) { base.Load(hud); AssignedSnoPower = Hud.Sno.SnoPowers.Monk_CycloneStrike; //聚力爆破1 疗伤清风2 CreateCastRule() .IfCanCastSkill(100, 200, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfRunning().ThenNoCastElseContinue() .IfIdle().ThenNoCastElseContinue() .IfPrimaryResourceIsEnough(100, ctx => 50).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 50, ctx => 1).ThenContinueElseNoCast() .IfTrue(ctx => { var range = ctx.Skill.Rune == 1 ? 34 : 24; return ctx.Hud.Game.ActorQuery.NearestBoss != null && ctx.Hud.Game.ActorQuery.NearestBoss.NormalizedXyDistanceToMe <= range && ctx.Skill.Player.Density.GetDensity(34) > 1; }).ThenNoCastElseContinue()//非单体BOSS不放技能 .IfTrue(ctx => { return (ctx.Skill.Rune == 2);//疗伤清风自动施放 }).ThenCastElseContinue() .IfTrue(ctx => { return (ctx.Skill.Player.Powers.BuffIsActive(Hud.Sno.SnoPowers.LefebvresSoliloquy.Sno, 0) && ctx.Skill.Player.Density.GetDensity(ctx.Skill.Rune == 1 ? 34 : 24) >= 1); }).ThenContinueElseNoCast()//带劝诫肩膀且非疗伤清风时符文优先保持减伤BUFF .IfSpecificBuffIsAboutToExpire(Hud.Sno.SnoPowers.Monk_CycloneStrike, 0, 1000, 1500).ThenCastElseContinue()//减伤BUFF ; CreateCastRule() .IfCanCastSkill(1000, 1000, 1000).ThenContinueElseNoCast() .IfInTown().ThenNoCastElseContinue() .IfCastingIdentify().ThenNoCastElseContinue() .IfCastingPortal().ThenNoCastElseContinue() .IfRunning().ThenNoCastElseContinue() .IfIdle().ThenNoCastElseContinue() .IfPrimaryResourceIsEnough(100, ctx => 50).ThenContinueElseNoCast() .IfEnoughMonstersNearby(ctx => 50, ctx => 1).ThenContinueElseNoCast() .IfTrue(ctx => { bool isLesserGods = ctx.Hud.Game.Me.Powers.BuffIsActive(485725); //蒙尘者绑腕 var range = ctx.Skill.Rune == 1 ? 34 : 24; bool isBossOrEliteNearby = ctx.Hud.Game.ActorQuery.IsEliteOrBossCloserThan(range, false) || ctx.Hud.Game.ActorQuery.NearestGoblin?.NormalizedXyDistanceToMe < range || ctx.Hud.Game.ActorQuery.NearestKeywarden?.NormalizedXyDistanceToMe < range; bool noLesserGodsDebuff = ctx.Hud.Game.AliveMonsters.Any(x => (isBossOrEliteNearby ? (x.Rarity == ActorRarity.Boss || x.Rarity == ActorRarity.Champion || x.Rarity == ActorRarity.Rare || x.Rarity == ActorRarity.Unique) : true) && x.NormalizedXyDistanceToMe < range && x.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, 485725) != 1); return isLesserGods && noLesserGodsDebuff; }).ThenCastElseContinue()//装备蒙尘者绑腕时周围有精英或BOSS没有触发debuff时施放,否则任何怪物没有触发debuff时施放 ; } } }