public static Composite DemonHunterBuffs() { return (new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), Common.CreateGetPowerGlobe(), Common.CreateUsePoolOfReflection(), new SelfCast(SNOPower.X1_DemonHunter_Companion, ctx => CompanionTimer.IsFinished && !Minion.HasPet(((CombatContext)ctx), Pet.DH_Companion), s => CompanionTimer.Reset()), new SelfCast(SNOPower.DemonHunter_Chakram, extra => BelphegorSettings.Instance.DemonHunter.ShurikenCloud && ShurikenCloudTimer.IsFinished, s => ShurikenCloudTimer.Reset()), new SelfCast(SNOPower.DemonHunter_SmokeScreen, extra => SmokeScreenTimer.IsFinished && ZetaDia.Me.HitpointsCurrentPct <= BelphegorSettings.Instance.DemonHunter .SmokeScreenHP || BelphegorSettings.Instance.DemonHunter.SpamSmokeScreen, s => SmokeScreenTimer.Reset()), Avoidance.CreateMoveForAvoidance( BelphegorSettings.Instance.DemonHunter.MaximumRange) )); }
public static Composite CreateStayAwayFromFrozenTargetsBehavior() { return(Avoidance.CreateAvoidanceBehavior( "Blink", TalentManager.HasGlyph("Blink") ? 28 : 20, Disengage.Direction.Frontwards, crowdControl: CreateSlowMeleeBehavior(), needDisengage: nd => Me.GotTarget() && Me.CurrentTarget.IsCrowdControlled() && Me.CurrentTarget.SpellDistance() < SingularSettings.Instance.KiteAvoidDistance, needKiting: nk => Me.GotTarget() && (Me.CurrentTarget.IsCrowdControlled() || Me.CurrentTarget.IsSlowed(60)) && Me.CurrentTarget.SpellDistance() < SingularSettings.Instance.KiteAvoidDistance )); }
/// <summary> /// creates a Mage specific avoidance behavior based upon settings. will check for safe landing /// zones before using Blink or Rocket Jump. will additionally do a running away or jump turn /// attack while moving away from attacking mob if behaviors provided /// </summary> /// <param name="nonfacingAttack">behavior while running away (back to target - instants only)</param> /// <param name="jumpturnAttack">behavior while facing target during jump turn (instants only)</param> /// <returns></returns> public static Composite CreateMageAvoidanceBehavior() { int distBlink = TalentManager.HasGlyph("Blink") ? 28 : 20; return(Avoidance.CreateAvoidanceBehavior( "Blink", distBlink, Disengage.Direction.Frontwards, crowdControl: CreateSlowMeleeBehavior(), needDisengage: nd => false, needKiting: nk => Me.GotTarget() && Me.CurrentTarget.IsFrozen() && Me.CurrentTarget.SpellDistance() < 8 )); }
public static Composite CrusaderBuff() { return (new Decorator(ctx => !ZetaDia.IsInTown, new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), Common.CreateGetPowerGlobe(), Common.CreateUsePoolOfReflection(), Avoidance.CreateMoveForAvoidance(BelphegorSettings.Instance.Crusader.MaximumRange) ) )); }
public static Composite BarbarianBuffs() { return (new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), new SelfCast(SNOPower.Barbarian_WarCry, extra => (!ZetaDia.Me.HasBuff(SNOPower.Barbarian_WarCry) || BelphegorSettings.Instance.Barbarian.SpamWarCry) && !ZetaDia.Me.IsInTown), Avoidance.CreateMoveForAvoidance(BelphegorSettings.Instance.Barbarian.MaximumRange) )); }
public static Composite WitchDoctorBuff() { return (new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), new SelfCast(SNOPower.Witchdoctor_Gargantuan, extra => !Minion.HasPet(Pet.Gargantuan)), new SelfCast(SNOPower.Witchdoctor_SummonZombieDog, extra => Minion.PetCount(Pet.ZombieDogs) < 3), Avoidance.CreateMoveForAvoidance( BelphegorSettings.Instance.WitchDoctor.MaximumRange) )); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); int armorCap = (int)Math.Ceiling((1402.5f * TargetLevel) - 66502.5f); float levelDifference = 0.2f * (TargetLevel - 70); dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Armor", BasicStats.Armor.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Agility", BasicStats.Agility.ToString()); dictValues.Add("Defense", Defense.ToString()); dictValues.Add("Miss", Miss.ToString() + "%"); dictValues.Add("Dodge", Dodge.ToString() + "%"); dictValues.Add("Parry", Parry.ToString() + "%"); dictValues.Add("Block", Block.ToString() + "%"); dictValues.Add("Block Value", BlockValue.ToString() + "%"); dictValues.Add("Avoidance", Avoidance.ToString() + "%"); dictValues.Add("Mitigation", Mitigation.ToString()); dictValues.Add("Spell Damage", _basicStats.SpellDamageRating.ToString()); dictValues.Add("Total Mitigation", TotalMitigation.ToString() + "%"); if (CritAvoidance == (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + "%*Exactly enough defense rating/resilience to be uncrittable by bosses."); } else if (CritAvoidance < (5f + levelDifference)) { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*CRITTABLE! Short by {0} defense rating or {1} resilience to be uncrittable by bosses.", Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 60f), Math.Ceiling(((5f + levelDifference) - CritAvoidance) * 39.423f))); } else { dictValues.Add("Chance to be Crit", ((5f + levelDifference) - CritAvoidance).ToString() + string.Format("%*Uncrittable by bosses. {0} defense rating or {1} resilience over the crit cap.", Math.Floor(((5f + levelDifference) - CritAvoidance) * -60f), Math.Floor(((5f + levelDifference) - CritAvoidance) * -39.423f))); } dictValues.Add("Overall Points", OverallPoints.ToString()); dictValues.Add("Mitigation Points", MitigationPoints.ToString()); dictValues.Add("Survival Points", SurvivalPoints.ToString()); dictValues.Add("Overall", Math.Round(OverallTPS) + " tps"); dictValues.Add("Holy Shield", Math.Round(HolyShieldTPS) + " tps"); dictValues.Add("Seal of Right", Math.Round(SoRTPS) + " tps"); dictValues.Add("Judgement of Right", Math.Round(JoRTPS) + " tps"); dictValues.Add("Consecrate", Math.Round(ConsecrateTPS) + " tps"); dictValues.Add("Misc", Math.Round(MiscTPS) + " tps"); return(dictValues); }
protected override void Initialize() { roar_clip = Resources.Load("Sounds/BOSS_roar") as AudioClip; footstep_clip = Resources.Load("Sounds/footsteps1") as AudioClip; fissure = Resources.Load("Skills/FireFissure") as GameObject; player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <Player>(); maxHealth = health; currentState = FSMState.Chase; currentAttackStance = AttackStance.NORMAL; animator = GetComponent <Animator>(); source = GetComponent <AudioSource>(); rigidBody = GetComponent <Rigidbody>(); avoidance = GetComponent <Avoidance>(); }
void InitAvoidance(L2D_BattleInit initMsg) { Data.Avoidance adv = new Data.Avoidance(); adv.pos = new F64Vec3(5, 0, 10); //adv.radius = F64.Half; adv.radius = new F64(1.6); logicDataManager.AddAvoidance(adv); initMsg.avoidances = new List <Avoidance>(); Avoidance av = new Avoidance(); av.pos = adv.pos.ToUnityVector3(); av.rad = adv.radius.Float; initMsg.avoidances.Add(av); }
// Update is called once per frame void Update() { if (isLeader) { //Me muevo independientemente. Con avoidance. LeaderDir = (Objective.transform.position - transform.position).normalized; if (Vector3.Distance(transform.position, Obstacle.transform.position) < AvoidanceRadius) { Avoid = Avoidance.getAvoidance(transform.position, Obstacle.transform.position); LeaderDir += Avoid; } LeaderDir.y = 0; transform.forward = Vector3.Slerp(transform.forward, LeaderDir, RotationSpeed * Time.deltaTime); transform.position += transform.forward * Velocity * Time.deltaTime; } else { List <Vector3> AllyPos = new List <Vector3>(); foreach (var Ally in Allies) { AllyPos.Add(Ally.transform.position); } if (Vector3.Distance(transform.position, Obstacle.transform.position) < AvoidanceRadius) { Avoid = Avoidance.getAvoidance(transform.position, Obstacle.transform.position); DirToGo += Avoid; } Le = (Leader.transform.position - transform.position).normalized; // Vector3 avoid = Avoidance.getAvoidance(transform.position,); Al = Floq.getAlignment(transform.position, AllyPos); Co = Floq.getCohesion(transform.position, AllyPos) * cohetionWeight; Se = Floq.getSeparation(transform.position, AllyPos, RadioDeFloq) * separationWeight; DirToGo = Avoid + Le + Al + Co + Se; DirToGo.y = 0; transform.forward = Vector3.Slerp(transform.forward, DirToGo, RotationSpeed * Time.deltaTime); transform.position += transform.forward * Velocity * Time.deltaTime; } }
public static Composite BarbarianBuffs() { return (new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), Common.CreateGetPowerGlobe(), Common.CreateUsePoolOfReflection(), new SelfCast(SNOPower.X1_Barbarian_WarCry_v2, extra => (!ZetaDia.Me.HasBuff(SNOPower.X1_Barbarian_WarCry_v2) || BelphegorSettings.Instance.Barbarian.SpamWarCry) && !ZetaDia.IsInTown), new SelfCast(SNOPower.Barbarian_BattleRage, extra => !ZetaDia.Me.HasBuff(SNOPower.Barbarian_BattleRage)), Avoidance.CreateMoveForAvoidance(BelphegorSettings.Instance.Barbarian.MaximumRange) )); }
/// <summary> /// Saves all the tabs at once /// </summary> public void SaveAll() { Save(); Barbarian.Save(); Crusader.Save(); DemonHunter.Save(); Monk.Save(); WitchDoctor.Save(); Wizard.Save(); Debug.Save(); Avoidance.Save(); Kiting.Save(); Log.Info("Saved All Settings"); }
public static int ToPriority(this Avoidance a) { switch (a) { case Avoidance.Fight: return(50); case Avoidance.Move: return(30); case Avoidance.Idle: return(5); default: Debug.LogErrorFormat("{0} isn't set in AvoidanceExtension."); return(99); } }
/// <summary> /// Creates a new request that traverses verticies /// </summary> public RequestTraverseVertex(IExpression myExpression, Avoidance myAvoid = Avoidance.None, Func<IVertex, IVertexType, IEdge, IAttributeDefinition, Boolean> myFollowThisEdge = null, Func<IVertex, IVertexType, Boolean> myMatchEvaluator = null, Action<IVertex> myMatchAction = null, Func<TraversalState, Boolean> myStopEvaluator = null) { Expression = myExpression; Avoid = myAvoid; FollowThisEdge = myFollowThisEdge; MatchEvaluator = myMatchEvaluator; MatchAction = myMatchAction; StopEvaluator = myStopEvaluator; }
/// <summary> /// Creates a new request that traverses verticies /// </summary> public RequestTraverseVertex(IExpression myExpression, Avoidance myAvoid = Avoidance.None, Func <IVertex, IVertexType, IEdge, IAttributeDefinition, Boolean> myFollowThisEdge = null, Func <IVertex, IVertexType, Boolean> myMatchEvaluator = null, Action <IVertex> myMatchAction = null, Func <TraversalState, Boolean> myStopEvaluator = null) { Expression = myExpression; Avoid = myAvoid; FollowThisEdge = myFollowThisEdge; MatchEvaluator = myMatchEvaluator; MatchAction = myMatchAction; StopEvaluator = myStopEvaluator; }
public static Composite WizardBuffs() { return (new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), new SelfCast(SNOPower.Wizard_MagicWeapon, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_MagicWeapon)), new SelfCast(SNOPower.Wizard_Familiar, extra => FamiliarTimer.IsFinished, s => FamiliarTimer.Reset()), new SelfCast(SNOPower.Wizard_EnergyArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_EnergyArmor)), new SelfCast(SNOPower.Wizard_StormArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_StormArmor)), new SelfCast(SNOPower.Wizard_IceArmor, extra => !ZetaDia.Me.HasBuff(SNOPower.Wizard_IceArmor)), Avoidance.CreateMoveForAvoidance( BelphegorSettings.Instance.Wizard.MaximumRange) )); }
public static Composite MonkBuff() { return (new Decorator(ctx => !ZetaDia.IsInTown, new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), Common.CreateGetPowerGlobe(), Common.CreateUsePoolOfReflection(), new SelfCast(SNOPower.Monk_BreathOfHeaven, ret => ZetaDia.Me.CurrentPrimaryResource > BelphegorSettings.Instance.Monk. BoHBlazingWrathOutOfCombatSpiritTreshold && !ZetaDia.Me.HasBuff(SNOPower.Monk_BreathOfHeaven) && BelphegorSettings.Instance.Monk.BoHBlazingWrath), Avoidance.CreateMoveForAvoidance(BelphegorSettings.Instance.Monk.MaximumRange) ) )); }
public static Composite MonkBuff() { return (new Decorator(ctx => !ZetaDia.Me.IsInTown, new PrioritySelector(CtxChanger, Common.CreateWaitForAttack(), Common.CreateWaitForCast(), new SelfCast(SNOPower.Monk_MysticAlly, extra => AllyTimer.IsFinished && !Minion.HasPet(Pet.MysticAlly), s => AllyTimer.Reset()), new SelfCast(SNOPower.Monk_BreathOfHeaven, ret => ZetaDia.Me.CurrentPrimaryResource > BelphegorSettings.Instance.Monk. BoHBlazingWrathOutOfCombatSpiritTreshold && !ZetaDia.Me.HasBuff(SNOPower.Monk_BreathOfHeaven) && BelphegorSettings.Instance.Monk.BoHBlazingWrath), Avoidance.CreateMoveForAvoidance(BelphegorSettings.Instance.Monk.MaximumRange) ) )); }
/// <summary> /// Creates a new request that traverses verticies /// </summary> public RequestTraverseVertex(String myVerexTypeName, long myVertexID, Avoidance myAvoid = Avoidance.None, Func<IVertex, IVertexType, IEdge, IAttributeDefinition, Boolean> myFollowThisEdge = null, Func<IVertex, IVertexType, Boolean> myMatchEvaluator = null, Action<IVertex> myMatchAction = null, Func<TraversalState, Boolean> myStopEvaluator = null) { VertexTypeName = myVerexTypeName; VertexID = myVertexID; Expression = null; Avoid = myAvoid; FollowThisEdge = myFollowThisEdge; MatchEvaluator = myMatchEvaluator; MatchAction = myMatchAction; StopEvaluator = myStopEvaluator; }
/// <summary> /// Creates a new request that traverses verticies /// </summary> public RequestTraverseVertex(String myVerexTypeName, long myVertexID, Avoidance myAvoid = Avoidance.None, Func <IVertex, IVertexType, IEdge, IAttributeDefinition, Boolean> myFollowThisEdge = null, Func <IVertex, IVertexType, Boolean> myMatchEvaluator = null, Action <IVertex> myMatchAction = null, Func <TraversalState, Boolean> myStopEvaluator = null) { VertexTypeName = myVerexTypeName; VertexID = myVertexID; Expression = null; Avoid = myAvoid; FollowThisEdge = myFollowThisEdge; MatchEvaluator = myMatchEvaluator; MatchAction = myMatchAction; StopEvaluator = myStopEvaluator; }
// Update is called once per frame void Update() { avoidance = Avoidance.getAvoidance(transform.position, Obstacle.transform.position); }
protected override void Apply(AttributeLoader loader, object wrapperObj) { if (!(wrapperObj is UnitMovementAttributesWrapper wrapper)) { throw new System.InvalidCastException(); } loader.ApplyPPatch(DriveType, () => wrapper.DriveType); if (Dynamics != null) { using (loader.logger.BeginScope($"Dynamics:")) { var w = new UnitDynamicsAttributesWrapper(wrapper.Dynamics); Dynamics.Apply(loader, w, null); wrapper.Dynamics = w; } } if (RandomDynamicsVariance != null) { using (loader.logger.BeginScope($"RandomDynamicsVariance:")) { var w2 = new UnitDynamicsRandomizationParametersWrapper(wrapper.RandomDynamicsVariance); RandomDynamicsVariance.Apply(loader, w2, null); wrapper.RandomDynamicsVariance = w2; } } if (Maneuvers != null) { using (loader.logger.BeginScope($"Maneuvers:")) { var w2 = new UnitManeuverAttributesWrapper(wrapper.Maneuvers); Maneuvers.Apply(loader, w2, null); wrapper.Maneuvers = w2; } } if (Hover != null) { using (loader.logger.BeginScope($"Hover:")) { var w2 = new HoverDynamicsAttributesWrapper(wrapper.Hover); Hover.Apply(loader, w2, null); wrapper.Hover = w2; } } if (Combat != null) { using (loader.logger.BeginScope($"Combat:")) { var w2 = new UnitCombatBehaviorAttributesWrapper(wrapper.Combat); Combat.Apply(loader, w2, null); wrapper.Combat = w2; } } if (Avoidance != null) { using (loader.logger.BeginScope($"Avoidance:")) { var w2 = new UnitAvoidanceAttributesWrapper(wrapper.Avoidance); Avoidance.Apply(loader, w2, null); wrapper.Avoidance = w2; } } if (ReversePolarity != null) { using (loader.logger.BeginScope($"ReversePolarity:")) { var w2 = new ReversePolarityAttributesWrapper(wrapper.ReversePolarity); ReversePolarity.Apply(loader, w2, null); wrapper.ReversePolarity = w2; } } }
public void ChangeState(Avoidance newState) { CurrentAvoidanceState = newState; }
/// <summary> /// creates a Priest specific avoidance behavior based upon settings. will check for safe landing /// zones before using WildCharge or rocket jump. will additionally do a running away or jump turn /// attack while moving away from attacking mob if behaviors provided /// </summary> /// <param name="nonfacingAttack">behavior while running away (back to target - instants only)</param> /// <param name="jumpturnAttack">behavior while facing target during jump turn (instants only)</param> /// <returns></returns> public static Composite CreatePriestAvoidanceBehavior() { // use Rocket Jump if available return(Avoidance.CreateAvoidanceBehavior("", 0, Disengage.Direction.Frontwards, new ActionAlwaysSucceed())); }
private void Start() { Avoidance av = GetComponent <Avoidance>(); av.tagsToAvoid = new string[] { "Hare", "Player", "Deer", "Wolf" }; }