public override void EndTransition(Navigator navigator, Navigator.ActiveTransition transition)
    {
        base.EndTransition(navigator, transition);
        bool flag  = (transition.start == NavType.Pole || transition.end == NavType.Pole) && transition.y < 0 && transition.x == 0;
        bool flag2 = transition.start == NavType.Tube || transition.end == NavType.Tube;

        if (!isWalking && !flag && !flag2 && (Object)attributeLevels != (Object)null)
        {
            attributeLevels.AddExperience(Db.Get().Attributes.Athletics.Id, Time.time - startTime, DUPLICANTSTATS.ATTRIBUTE_LEVELING.ALL_DAY_EXPERIENCE);
        }
    }
コード例 #2
0
    protected override bool OnWorkTick(Worker worker, float dt)
    {
        CircuitManager circuitManager = Game.Instance.circuitManager;
        bool           flag           = false;

        if (circuitManager != null)
        {
            ushort circuitID = circuitManager.GetCircuitID(powerCell);
            bool   flag2     = circuitManager.HasBatteries(circuitID);
            flag = ((flag2 && circuitManager.GetMinBatteryPercentFullOnCircuit(circuitID) < 1f) || (!flag2 && circuitManager.HasConsumers(circuitID)));
        }
        AttributeLevels component = worker.GetComponent <AttributeLevels>();

        if ((Object)component != (Object)null)
        {
            component.AddExperience(Db.Get().Attributes.Athletics.Id, dt, DUPLICANTSTATS.ATTRIBUTE_LEVELING.ALL_DAY_EXPERIENCE);
        }
        return(!flag);
    }
コード例 #3
0
            public static void Postfix(ref Worker worker, float dt, ref ManualGenerator __instance)
            {
                if (!Settings.Instance.Gym.IncludeRoom)
                {
                    return;
                }
                if (RoomTypes_AllModded.IsInTheRoom(__instance, RoomTypeGymData.RoomId))
                {
                    if (string.IsNullOrEmpty(AthleticsId))
                    {
                        AthleticsId = Db.Get().Attributes.Athletics.Id;
                    }

                    AttributeLevels component = worker.GetComponent <AttributeLevels>();
                    if (component != null && Settings.Instance.Gym.Bonus.HasValue)
                    {
                        component.AddExperience(AthleticsId,
                                                dt * Settings.Instance.Gym.Bonus.Value,
                                                DUPLICANTSTATS.ATTRIBUTE_LEVELING.ALL_DAY_EXPERIENCE);
                    }
                }
            }