예제 #1
0
파일: CLU.cs 프로젝트: Asphodan/Alphabuddy
        /// <summary>
        /// sets the character's active rotation.
        /// Print the help located in the specific rotation
        /// </summary>
        /// <param name="rb">an instance of the rotationbase</param>
        private void SetActiveRotation(RotationBase rb)
        {
            CLULogger.Log(" Greetings, level {0} user!", Me.Level);
            CLULogger.Log(" I am CLU.");
            CLULogger.Log(" I will create the perfect system for you.");
            CLULogger.Log(" I suggest we use the " + rb.Name + " rotation. Revision: " + rb.Revision);
            CLULogger.Log(" as I know you have " + rb.KeySpell);
            CLULogger.Log(" BotBase: {0}  ({1})", BotManager.Current.Name, BotChecker.SupportedBotBase() ? "Supported" : "Currently Not Supported");
            CLULogger.Log(rb.Help);
            CLULogger.Log(" You can Access CLU's Settings by clicking the CLASS CONFIG button");
            CLULogger.Log(" Let's execute the plan!");

            this._rotationBase = rb;

            this.PulseEvent = null;
            this.PulseEvent += rb.OnPulse;

            // Check for Instancebuddy and warn user that healing is not supported.
            if (BotChecker.BotBaseInUse("Instancebuddy") && this.ActiveRotation.GetType().BaseType == typeof(HealerRotationBase))
            {
                CLULogger.Log(" [BotChecker] Instancebuddy Detected. *UNABLE TO HEAL WITH CLU*");
                StopBot("You cannot use CLU with InstanceBuddy as Healer");
            }

            if (this.ActiveRotation.GetType().BaseType == typeof(HealerRotationBase))
            {
                CLULogger.TroubleshootLog(" [HealingChecker] HealerRotationBase Detected. *Activating Automatic HealableUnit refresh*");
                IsHealerRotationActive = true;
            }
        }
예제 #2
0
파일: CLU.cs 프로젝트: Asphodan/Alphabuddy
        public bool CreateBehaviors()
        {
            CLULogger.TroubleshootLog("CreateBehaviors called.");
            // let behaviors be notified if context changes.
            if (OnLocationContextChanged != null)
                OnLocationContextChanged(this, new LocationContextEventArg(LocationContext, LastLocationContext));

            //Caching the context to not recreate same behaviors repeatedly.
            LastLocationContext = LocationContext;

            _rotationBase = null;

            if (_combatBehavior != null) this._combatBehavior = new Decorator(ret => AllowPulse, this.Rotation);

            if (_combatBuffBehavior != null) this._combatBuffBehavior = new Decorator(ret => AllowPulse, this.Medic);

            if (_preCombatBuffBehavior != null) this._preCombatBuffBehavior = new Decorator(ret => AllowPulse, this.PreCombat);

            if (_restBehavior != null) this._restBehavior = new Decorator(ret => !(CLUSettings.Instance.NeverDismount && IsMounted) && !Me.IsFlying, this.Resting);

            if (_pullBehavior != null) this._pullBehavior = new Decorator(ret => AllowPulse, this.Pulling);

            return true;
        }