Пример #1
0
        public static float CalculatedWeight(Item item, Targets.Item target, bool simulation = false)
        {
            try
            {
                if (item.Weight == 0)
                {
                    return 0;
                }

                return item.Weight *
                       (item.Inverted ? (simulation ? item.SimulationMinValue : item.MinValue) : GetValue(item, target)) /
                       (item.Inverted ? GetValue(item, target) : item.MaxValue);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return 0;
        }
Пример #2
0
 public static float GetValue(Item item, Targets.Item target)
 {
     try
     {
         var value = item.GetValueFunc(target.Hero);
         return value > 1 ? value : 1;
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
         return item.Inverted ? item.MaxValue : item.MinValue;
     }
 }
Пример #3
0
 public Item(Obj_AI_Hero sender, Targets.Item target)
 {
     Sender = sender;
     Target = target;
     Timestamp = Game.Time;
 }