Esempio n. 1
0
 /// <summary>
 /// Initializes the level lookup table.
 /// </summary>
 /// <param name="rawLevels">The levels taken from the stock AttributeLevels object.</param>
 internal void Initialize(IList <AttributeLevel> rawLevels)
 {
     foreach (var level in rawLevels)
     {
         attrLevels.Add(level.attribute.Id, level);
     }
     trainingSpeed = converters.Get(Db.Get().AttributeConverters.TrainingSpeed);
 }
 public float GetDamageMultiplier()
 {
     if (attributeConverter != null && (Object)base.worker != (Object)null)
     {
         AttributeConverterInstance converter = base.worker.GetComponent <AttributeConverters>().GetConverter(attributeConverter.Id);
         return(Mathf.Max(1f + converter.Evaluate(), 0.1f));
     }
     return(1f);
 }
Esempio n. 3
0
 /// <summary>
 /// Applied before Lookup runs.
 /// </summary>
 internal static bool Prefix(GameObject go, ref AttributeConverterInstance __result,
                             AttributeConverter __instance)
 {
     if (go != null && go.TryGetComponent(out FastAttributeConverters fc))
     {
         __result = fc.Get(__instance);
     }
     else
     {
         __result = null;
     }
     return(false);
 }
Esempio n. 4
0
 /// <summary>
 /// Applied before Lookup runs.
 /// </summary>
 internal static bool Prefix(Component cmp, ref AttributeConverterInstance __result,
                             AttributeConverter __instance)
 {
     if (cmp != null && cmp.TryGetComponent(out FastAttributeConverters fc))
     {
         __result = fc.Get(__instance);
     }
     else
     {
         __result = null;
     }
     return(false);
 }
 public BipedTransitionLayer(Navigator navigator, float floor_speed, float ladder_speed)
     : base(navigator)
 {
     navigator.Subscribe(1773898642, delegate
     {
         isWalking = true;
     });
     navigator.Subscribe(1597112836, delegate
     {
         isWalking = false;
     });
     floorSpeed      = floor_speed;
     ladderSpeed     = ladder_speed;
     jetPackSpeed    = floor_speed;
     movementSpeed   = Db.Get().AttributeConverters.MovementSpeed.Lookup(navigator.gameObject);
     attributeLevels = navigator.GetComponent <AttributeLevels>();
 }
Esempio n. 6
0
 internal FastAttributeLevels()
 {
     attrLevels    = new Dictionary <string, AttributeLevel>(32);
     trainingSpeed = null;
 }