/// <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); }
/// <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); }
/// <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>(); }
internal FastAttributeLevels() { attrLevels = new Dictionary <string, AttributeLevel>(32); trainingSpeed = null; }