public async Task <bool> Run()
        {
            if (RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult") != null)
            {
                GameStatsManager.Died();
                Logger.Warn($"We have died...");
                RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult").SendAction(1, 3, uint.MaxValue);
                await Coroutine.Sleep(250);

                return(true);
            }
            if (NotificationRevive.IsOpen)
            {
                NotificationRevive.Click();
                await Coroutine.Wait(250, () => SelectYesno.IsOpen);

                SelectYesno.ClickYes();
                return(true);
            }
            if (ClientGameUiRevive.ReviveState == ReviveState.Dead && SelectYesno.IsOpen)
            {
                SelectYesno.ClickYes();
                return(true);
            }
            if (Core.Me.IsDead)
            {
                TreeRoot.StatusText = "I am dead. No window to use...";
                await Coroutine.Sleep(250);

                return(true);
            }
            return(false);
        }
 public static MonsterHuntQuest AddProceduralQuest(MonsterHuntQuest quest)
 {
     if (HuntData == null)
     {
         DoSetup();
     }
     HuntData.ProceduralQuests.Add(quest);
     if (GameStatsManager.HasInstance && GameStatsManager.Instance.huntProgress != null)
     {
         GameStatsManager.Instance.huntProgress.OnLoaded();
     }
     else
     {
         int?cachedHuntIndex = null;
         if (AdvancedGameStatsManager.HasInstance)
         {
             cachedHuntIndex = AdvancedGameStatsManager.Instance.cachedHuntIndex;
             AdvancedGameStatsManager.Save();
         }
         GameStatsManager.Load();
         if (cachedHuntIndex != null && AdvancedGameStatsManager.HasInstance)
         {
             AdvancedGameStatsManager.Instance.cachedHuntIndex = cachedHuntIndex.Value;
         }
     }
     if (addedProceduralQuests == null)
     {
         addedProceduralQuests = new List <MonsterHuntQuest>();
     }
     addedProceduralQuests.Add(quest);
     return(quest);
 }
        public static IEnumerator DelayedStartCR()
        {
            yield return(null);

            GameStatsManager.Load();
            yield break;
        }
Exemple #4
0
 public void Start()
 {
     //Do Something
     singleton = this;
     DontDestroyOnLoad(this);
     roundPlayerData = new List<RoundPlayerObjectManager>();
     roundScoreData = new List<RoundScoreManager>();
 }
Exemple #5
0
        private static void LoadGameStatsFirstLoad()
        {
            bool cachedvalue = FirstLoad;

            FirstLoad = true;
            GameStatsManager.Load();
            FirstLoad = cachedvalue;
        }
 public static void Unload()
 {
     if (!m_loaded)
     {
         return;
     }
     if (addedOrderedQuests != null)
     {
         foreach (MonsterHuntQuest q in addedOrderedQuests)
         {
             if (HuntData.OrderedQuests.Contains(q))
             {
                 HuntData.OrderedQuests.Remove(q);
             }
         }
         addedOrderedQuests.Clear();
         addedOrderedQuests = null;
     }
     if (addedProceduralQuests != null)
     {
         foreach (MonsterHuntQuest q in addedProceduralQuests)
         {
             if (HuntData.ProceduralQuests.Contains(q))
             {
                 HuntData.ProceduralQuests.Remove(q);
             }
         }
         addedProceduralQuests.Clear();
         addedProceduralQuests = null;
     }
     if (GameStatsManager.HasInstance && GameStatsManager.Instance.huntProgress != null)
     {
         GameStatsManager.Instance.huntProgress.OnLoaded();
     }
     else
     {
         int?cachedHuntIndex = null;
         if (AdvancedGameStatsManager.HasInstance)
         {
             cachedHuntIndex = AdvancedGameStatsManager.Instance.cachedHuntIndex;
             AdvancedGameStatsManager.Save();
         }
         GameStatsManager.Load();
         if (cachedHuntIndex != null && AdvancedGameStatsManager.HasInstance)
         {
             AdvancedGameStatsManager.Instance.cachedHuntIndex = cachedHuntIndex.Value;
         }
     }
     HuntData = null;
     huntProgressLoadedHook?.Dispose();
     huntProgressCompleteHook?.Dispose();
     huntProgressNextQuestHook?.Dispose();
     huntProgressProcessKillHook?.Dispose();
     huntQuestCompleteHook?.Dispose();
     huntQuestUnlockRewardsHook?.Dispose();
     huntProgressQuestCompleteHook?.Dispose();
     m_loaded = false;
 }
Exemple #7
0
        public static void SetPlayerStats(System.Action <GameStatsManager, TrackedStats, float> orig,
                                          GameStatsManager self, TrackedStats trackedStats, float value)
        {
            orig(self, trackedStats, value);

            if (trackedStats == TrackedStats.TIME_PLAYED && value == 0f)
            {
                GameManager.Instance.PrimaryPlayer.GiveItem("heart_holster");
            }
        }
Exemple #8
0
    public void EndGame()
    {
        Debug.Log("Sending info");
        Time.timeScale = 0;
        GameStatsManager gameStatsManager = new GameStatsManager(FindObjectOfType <PlayerData>().PlayerLogin.username, numSeconds);
        string           json             = JsonUtility.ToJson(gameStatsManager);

        StartCoroutine(HTTPCOnnector.instance.PostRequest("http://cheapdell.ddns.net:25567/leaderboard", json));
        endGameUI.SetActive(true);
        endGameUI.GetComponentInChildren <TextMeshProUGUI>().SetText("Your time was " + string.Format("{0:00.00}", numSeconds) + " seconds!");
    }
Exemple #9
0
 // Update is called once per frame
 void Update()
 {
     Instance = this;
     if (laserText != null)
     {
         laserText.text = (lasersStr + noOfLasers).ToString();
     }
     if (missileText != null)
     {
         missileText.text = (missilesStr + noOfMissiles).ToString();
     }
 }
Exemple #10
0
 void Awake()
 {
     if (Instance != null)
     {
         if (Instance != this)
         {
             Destroy(this.gameObject);
         }
     }
     else
     {
         Instance = this;
     }
 }
Exemple #11
0
        /// <summary>
        /// Revalidates the current <see cref="AdvancedMidGameSaveData"/>
        /// </summary>
        /// <param name="saveStats">If true, it will also save <see cref="AdvancedGameStats"/></param>
        public static void RevalidateMidgameSave(bool saveStats)
        {
            AdvancedMidGameSaveData midGameSaveData = null;

            if (VerifyAndLoadMidgameSave(out midGameSaveData, false))
            {
                midGameSaveData.Revalidate();
                SaveManager.Save(midGameSaveData, DaveAPIManager.AdvancedMidGameSave, GameStatsManager.Instance.PlaytimeMin, 0u, null);
                GameStatsManager.Instance.midGameSaveGuid = midGameSaveData.midGameSaveGuid;
                if (saveStats)
                {
                    GameStatsManager.Save();
                }
            }
        }
Exemple #12
0
        /// <summary>
        /// Анализирует успешность альбома
        /// </summary>
        public override void Analyze(AlbumInfo album)
        {
            var totalFans = PlayerManager.Data.Fans;

            GameStatsManager.Analyze(album.TrendInfo);

            var resultPoints = fansToPointsIncomeCurve.Evaluate(totalFans) * (album.TextPoints + album.BitPoints);

            resultPoints += resultPoints * Mathf.Lerp(0, trendsEqualityMultiplier, album.TrendInfo.EqualityValue);

            album.ListenAmount  = (int)listenAmountCurve.Evaluate(resultPoints);
            album.ChartPosition = (int)chartPositionCurve.Evaluate(album.ListenAmount);

            var hypeImpact = hypeImpactMultiplier * PlayerManager.Data.Hype;
            var fansIncomeFromListeners = fansIncomeCurve.Evaluate(totalFans) * album.ListenAmount;

            album.FansIncome  = (int)(hypeImpact * fansIncomeFromListeners);
            album.MoneyIncome = moneyIncomeMultiplier * album.ListenAmount;
        }
        public static bool RainbowButBetter(Func <GameStatsManager, bool> orig, GameStatsManager self)
        {
            if (orig(self) && Pixelator.HasInstance)
            {
                radius.SetVector("_WaveCenter", new Vector4(0.5f, 0.5f, 0f, 0f));
                radius.SetFloat("_DistortProgress", 0.5f);
                radius.SetFloat("_Strength", 0.4f);
                radius.SetFloat("_TimePulse", 1f);
                Pixelator.Instance.RegisterAdditionalRenderPass(radius);


                line.SetVector("_WavePoint1", new Vector4(0f, 0f, 1f, 1f));
                line.SetVector("_WavePoint2", new Vector4(1f, 1f, 1f, 1f));
                line.SetFloat("_DistortProgress", 0.5f);
                Pixelator.Instance.RegisterAdditionalRenderPass(line);

                rainbowUpdate.enabled = true;

                RainbowMat.SetFloat("_AllColorsToggle", 1f);

                Pixelator.Instance.RegisterAdditionalRenderPass(RainbowMat);
                Pixelator.Instance.RegisterAdditionalRenderPass(GonnerMat);



                if (GameManager.Instance.PrimaryPlayer != null)
                {
                    GameManager.Instance.PrimaryPlayer.SetOverrideShader(GonnerMat.shader);
                }
                if (GameManager.Instance.SecondaryPlayer != null)
                {
                    GameManager.Instance.SecondaryPlayer.SetOverrideShader(GonnerMat.shader);
                }
            }
            else
            {
                rainbowUpdate.enabled = false;
            }
            return(orig(self));
        }
Exemple #14
0
        //
        // GET: /Stats/

        public ActionResult Index(GameFilterViewModel model)
        {
            ViewBag.TeamItems   = listItems.TeamsOnly();
            ViewBag.SeasonItems = listItems.Seasons();

            if (model.Team == 0 && model.Season == 0)
            {
                model.Season = Convert.ToInt64(ViewBag.SeasonItems[0].Value);
                model.Team   = Convert.ToInt64(ViewBag.TeamItems[0].Value);
            }

            ViewBag.CompetitionItems = listItems.CompetitionsOfTeam(model.Team);

            IList <Game> games = gamedao.GetByFilter(model);

            GameStatsManager gsm = new GameStatsManager(games);

            ViewBag.Results         = gsm.Results();
            ViewBag.Stats           = gsm.OverAllStats();
            ViewBag.ResultsShooters = gsm.Shooters();
            ViewBag.ResultsGoals    = gsm.Goals();
            return(View());
        }
Exemple #15
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
 }
Exemple #16
0
 public static void NewSession(Action <GameStatsManager, PlayerController> orig, GameStatsManager self, PlayerController player)
 {
     orig(self, player);
     if (OnNewGame != null)
     {
         OnNewGame(player);
     }
 }
Exemple #17
0
 // Token: 0x06000184 RID: 388 RVA: 0x000140F0 File Offset: 0x000122F0
 public static void SetFlag(this GameStatsManager manager, CustomDungeonFlags flag, bool value)
 {
     CustomGungeonFlagsManager.SetCustomDungeonFlag(flag, value);
 }
Exemple #18
0
 // Token: 0x06000185 RID: 389 RVA: 0x000140FB File Offset: 0x000122FB
 public static void SetStat(this GameStatsManager manager, CustomTrackedStats stat, float value)
 {
     CustomTrackedStatsManager.SetCustomStat(stat, value);
 }
Exemple #19
0
 // Token: 0x06000186 RID: 390 RVA: 0x00014106 File Offset: 0x00012306
 public static void RegisterStatChange(this GameStatsManager manager, CustomTrackedStats stat, float value)
 {
     CustomTrackedStatsManager.RegisterStatChange(stat, value);
 }
Exemple #20
0
 public static GameStats MoveSessionStatsHook(Func <GameStatsManager, GameStats> orig, GameStatsManager self)
 {
     AdvancedGameStatsManager.Instance.MoveSessionStatsToSavedSessionStats();
     return(orig(self));
 }
Exemple #21
0
 public static void ClearAllStatsHook(Action <GameStatsManager> orig, GameStatsManager self)
 {
     orig(self);
     AdvancedGameStatsManager.Instance.ClearAllStatsGlobal();
 }
Exemple #22
0
 public static void EndSessionHook(Action <GameStatsManager, bool, bool> orig, GameStatsManager self, bool recordSessionStats, bool decrementDifferentiator = true)
 {
     orig(self, recordSessionStats, decrementDifferentiator);
     AdvancedGameStatsManager.Instance.EndSession(recordSessionStats);
 }
Exemple #23
0
 public static void BeginSessionHook(Action <GameStatsManager, PlayerController> orig, GameStatsManager self, PlayerController player)
 {
     orig(self, player);
     AdvancedGameStatsManager.Instance.BeginNewSession(player);
 }
Exemple #24
0
 // Token: 0x06000187 RID: 391 RVA: 0x00014114 File Offset: 0x00012314
 public static bool GetFlag(this GameStatsManager manager, CustomDungeonFlags flag)
 {
     return(CustomGungeonFlagsManager.GetCustomDungeonFlag(flag));
 }
Exemple #25
0
 // Token: 0x06000188 RID: 392 RVA: 0x0001412C File Offset: 0x0001232C
 public static float GetPlayerStatValue(this GameStatsManager manager, CustomTrackedStats stat)
 {
     return(CustomTrackedStatsManager.GetCustomStat(stat));
 }