Esempio n. 1
0
 private void Init()
 {
     Wellapad = new MutableDataWellapad();
     PetInfo  = new MutableDataPetInfo();
     allMutableData.Add(PetInfo);
     Cutscenes         = new MutableDataCutscene();
     Decorations       = new MutableDataDecorationSystem();
     Accessories       = new MutableDataAccessories();
     Stats             = new MutableDataStats();
     Level             = new MutableDataPetLevel();
     PlayPeriod        = new MutableDataPlayPeriod();
     Degradation       = new MutableDataDegradation();
     Inhaler           = new MutableDataInhaler();
     Tutorial          = new MutableDataTutorial();
     Inventory         = new MutableDataInventory();
     Badge             = new MutableDataBadge();
     GatingProgress    = new MutableDataGatingProgress();
     HighScore         = new MutableDataHighScore();
     FirstTimeEntrance = new MutableDataFirstTimeEntrance();
     SickNotification  = new MutableDataSickNotification();
     MiniPets          = new  MutableDataMiniPets();
     MiniPetLocations  = new MutableDataMiniPetLocations();
     MicroMix          = new MutableDataMicroMix();
     AdViews           = new MutableDataAdData();
 }
Esempio n. 2
0
    /// <summary>
    /// Depending on how long the player has been away and what time of day it is, return the number of
    /// new triggers that should spawn.
    /// <summary>
    private int GetNewTriggerCount()
    {
        int newTriggers = 0;
        MutableDataDegradation degradationData = DataManager.Instance.GameData.Degradation;
        int playPeriodsOffset = GetNumPlayPeriodsOffset();

        //There are missed play periods
        if (playPeriodsOffset > 1)
        {
            //max of 2 missed play period will be accounted
            if (playPeriodsOffset > 2)
            {
                playPeriodsOffset = 2;
            }

            //calculate num of new triggers
            newTriggers = playPeriodsOffset * 3;

            //update lastTriggerSpawnedPlayPeriod. Important that we update it here
            //otherwise more triggers will be spawned if user return from pause
            degradationData.LastPlayPeriodTriggerSpawned = PlayPeriodLogic.GetCurrentPlayPeriod();
            Debug.Log("Missed play periods spawning " + newTriggers + "triggers");
        }
        //No missed play periods. spawn triggers for Next Play Period
        else
        {
            DateTime now = LgDateTime.GetTimeNow();
            DateTime lastTriggerSpawnedPlayPeriod = degradationData.LastPlayPeriodTriggerSpawned;
            TimeSpan timeSinceLastTriggerSpawned  = now - lastTriggerSpawnedPlayPeriod;

            //only spawn new trigger if time hasn't been rewind somehow
            if (lastTriggerSpawnedPlayPeriod <= now)
            {
                //new play period need to refresh variable
                if (timeSinceLastTriggerSpawned.TotalHours >= 12)
                {
                    degradationData.IsTriggerSpawned = false;
                }

                if (!degradationData.IsTriggerSpawned)
                {
                    newTriggers = 3;
                    degradationData.IsTriggerSpawned             = true;
                    degradationData.LastPlayPeriodTriggerSpawned = PlayPeriodLogic.GetCurrentPlayPeriod();
                }
            }
        }
        return(newTriggers);
    }