Exemple #1
0
 public TalentProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #2
0
            private CacheInternal Cache; // = new CacheInternal(GetUnit);

            #endregion Fields

            #region Constructors

            public TargetProxy(GetUnitDelegate del)
                : base(del)
            {
                health = new HealthProxy(() => GetUnit());
                Cache = new CacheInternal(GetUnit,"targetproxy");

                //Cache.AddProperty("time_to_die", () => health.TimeToDie);
                Cache.AddProperty("melee_range", () => GetUnit().IsWithinMeleeRange);
                Cache.AddProperty("facing", () => Me.IsFacing(GetUnit()));
                Cache.AddProperty("distance", () => GetUnit().Distance);
            }
Exemple #3
0
 public Composite Cast(String _spell, GetUnitDelegate getTarget, String Reason)
 {
     return(Cast(_spell, null, getTarget, Reason));
 }
Exemple #4
0
 public SpellProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #5
0
 public CooldownProxy(GetUnitDelegate del)
     : base(del)
 {
     potion = new Potion(this);
 }
Exemple #6
0
 public EclipseProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #7
0
 public RageProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #8
0
 public ChiProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #9
0
 public HolyPowerProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #10
0
 public ManaProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #11
0
 public HealthProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #12
0
 public GlyphProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #13
0
 public FocusProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #14
0
 public UnitBasedProxy(GetUnitDelegate del)
 {
     GetUnit = del;
 }
Exemple #15
0
 public ResourceProxy(GetUnitDelegate del)
     : base(del)
 {
     cache["regen"].SetRetrievalDelegate(() =>
     {
         if (simc.main_resource == simc.mana) return (Decimal)Me.ManaInfo.RegenFlatModifier;
         return LuaGet<double>(
             "inactiveRegen, activeRegen = GetPowerRegen(); return activeRegen;", 0);
     });
     cache["percent"].SetRetrievalDelegate(() => GetPercent);
     cache["current"].SetRetrievalDelegate(() => GetCurrent);
     cache["max"].SetRetrievalDelegate(() => GetMax);
 }
Exemple #16
0
 public BuffProxy(GetUnitDelegate del, AuraProxy ar)
     : base(del)
 {
     Source = ar;
     pre_steady_focus = new PreSteadyFocus(this);
     bloodlust = new Bloodlust(this);
     potion = new Potion(this);
     anytrinket = new AnyTrinket(this);
     incanters_flow = new IncantersFlow(this);
     raging_blow = new BuffInternal(dbc.Spells[131116], this, "raging_blow_special");
     colossus_smash = new DebuffProxy.DebuffInternal(dbc.Spells[SimcNames.debuffs["colossus_smash"].First().V2], this, "colossus_smash");
     colossus_smash_up = new DebuffProxy.DebuffInternal(dbc.Spells[SimcNames.debuffs["colossus_smash"].First().V2], this, "colossus_smash_up");
 }
Exemple #17
0
 public RuneProxy(GetUnitDelegate del, RuneType type)
     : base(del)
 {
     this.type = type;
 }
Exemple #18
0
 public ComboPointProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #19
0
 public RunicPowerProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #20
0
 public DebuffProxy(GetUnitDelegate del)
     : base(del)
 {
     casting = new Casting(this);
 }
Exemple #21
0
 protected SpellBasedProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #22
0
 public EnergyProxy(GetUnitDelegate del)
     : base(del)
 {
 }
Exemple #23
0
        public Composite Cast(String _spell, CanRunDecoratorDelegate del, GetUnitDelegate getTarget, String Reason)
        {
            NameCount++;

            WoWUnit _target;

            var actualSpell = LearnedSpellFromToken(_spell);

            if (actualSpell == null)
            {
                Write("Couldnt find " + _spell + " in our spellbook or in the Simcraft table");
                return(new ActionAlwaysFail());
            }



            return(new NamedComposite("" + NameCount, actualSpell.name,
                                      new Action(delegate
            {
                _target = getTarget();
                //if (_target != null && _target != Target1()) Write("Checking diff target");

                conditionName = NameCount;
                _conditionSpell = actualSpell;

                conditionUnit = _target;
                if (conditionUnit == null || conditionUnit == default(WoWUnit))
                {
                    conditionUnit = Me.CurrentTarget;
                }

                return RunStatus.Failure;
            }),
                                      new Decorator(_ret =>
            {
                if (actualSpell.gcd > 0 && SpellManager.GlobalCooldown)
                {
                    LogDebug("GCD Skip: " + actualSpell.name);
                    return false;
                }
                var d = del ?? (ret => true);
                try
                {
                    LogDebug(actualSpell.name + " if=" + Reason);
                    var r = d(_ret);
                    LogDebug(actualSpell.name + " => " + r);
                    if (!r)
                    {
                        return false;
                    }
                    return (CanCast(actualSpell.name, conditionUnit));
                }
                catch (Exception e)
                {
                    //Write(conditionName + " " + _spell + " " + e.ToString());
                    return false;
                }
            },
                                                    new Action(delegate
            {
                clickUnit = conditionUnit;
                //if (SpellManager.CanCast(spell.name, conditionUnit))
                if (CastSpell(actualSpell, conditionUnit, 3, Reason))
                {
                    //if (actualSpell.name.Contains("Fire")) Write("fire:"+conditionUnit.Guid.GetFriendlyString());
                    //LogDebug(_spell +  " => SUCCESS!");
                    start_line_cd();
                    return RunStatus.Success;
                }
                else
                {
                    LogDebug(_spell + " => FAIL!");
                }
                return RunStatus.Failure;
            }))));
        }