Ejemplo n.º 1
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;
     }
 }
Ejemplo n.º 2
0
 public Item(Obj_AI_Hero sender, Targets.Item target)
 {
     Sender = sender;
     Target = target;
     Timestamp = Game.Time;
 }
Ejemplo n.º 3
0
 public static float CalculatedWeight(Item item, Targets.Item target, bool simulation = false)
 {
     try
     {
         if (item.Weight == 0)
         {
             return 0;
         }
         return item.Inverted
             ? item.Weight -
               (item.Weight * (GetValue(item, target) - (simulation ? item.SimulationMinValue : item.MinValue)) /
                (simulation ? item.SimulationMaxValue : item.MaxValue))
             : item.Weight * GetValue(item, target) / (simulation ? item.SimulationMaxValue : item.MaxValue);
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return 0;
 }