public async Task Process(INetworkMessage message, GameNetworkContext context)
        {
            if (await context.FaultyState(GameState.Online))
            {
                return;
            }
            if (message is TutorialStartRequest tutorialStart)
            {
                await using (var uow = _unitOfWorkFactory.Create())
                {
                    var tutorial = await uow.TutorialProgress.Where(p => p.CharacterId == context.Character.Id && p.TutorialId == tutorialStart.TutorialId).FirstOrDefaultAsync();

                    if (tutorial == null)
                    {
                        tutorial = new TutorialProgress()
                        {
                            CharacterId = context.Character.Id,
                            TutorialId  = tutorialStart.TutorialId
                        };
                        uow.TutorialProgress.Add(tutorial);
                    }
                    tutorial.Attempts++;
                    await uow.CommitAsync();
                }
            }
        }
 public static bool AreAllTutorialsComplete(TutorialProgress progress)
 {
     if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE)
     {
         return(false);
     }
     return(progress == TutorialProgress.ILLIDAN_COMPLETE);
 }
 public static void ResetData()
 {
     data = new TutorialProgress();
     data.Init();
     cacheHasSeenTutorial.Clear();
     activeTutorials.Clear();
     Save();
 }
 private void Start()
 {
     //Initialise states and asteroids
     CurState = TutorialProgress.Initialise;
     gameController.GetComponent <GameController>().setAsteroidNumber(numAsteroids);
     maxScore = 85 * numAsteroids;
     //Carry playername through to next stage avoiding erasure of playerprefs
     username = PlayerPrefs.GetString("Username");
 }
Пример #5
0
    public IEnumerator wasdTutorial()
    {
        yield return(new WaitForSeconds(2f));

        Tutorial.text = "Checking Systems...\nTrying wasd to move. Computing...";
        prog          = TutorialProgress.done;
        yield return(new WaitForSeconds(5f));

        Tutorial.text = "";
    }
Пример #6
0
 public bool GetTutorialProgress(string stepId)
 {
     if (!TutorialProgress.ContainsKey(stepId))
     {
         return(false);
     }
     else
     {
         return(TutorialProgress[stepId]);
     }
 }
Пример #7
0
    protected bool DidLoseTutorial(TutorialProgress val)
    {
        int  @int = Options.Get().GetInt(Option.TUTORIAL_LOST_PROGRESS);
        bool flag = false;

        if ((@int & (((int)1) << ((int)val))) > 0)
        {
            flag = true;
        }
        return(flag);
    }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     if (GameObject.Find("Tutorial Manager"))
     {
         tp = GameObject.Find("Tutorial Manager").GetComponent <TutorialProgress>();
     }
     //Color c1 = thirdPersonModel.material.color; //this is a problem, fix. It changes main characters transparensy to 0
     //thirdPersonModel.material.color = new Color(c1.r, c1.g, c1.b, 0);
     //Color c2 = thirdPersonMask.material.color;
     //thirdPersonMask.material.color = new Color(c2.r, c2.g, c2.b, 0);
     mask = 1 << 8;
 }
Пример #9
0
        public TutorialBubble()
        {
            _tutorialProgress = TutorialProgress.TutorialAddSampleVideo;

            InitializeComponent();

            BackColor = Color.Transparent;

            nextButton.BackColor = Color.FromArgb(187, 187, 187); // color of tooltip gray

            DesignLanguage.ApplyCustomFont(this);
        }
    private static void Load()
    {
        var textData = PlayerPrefs.GetString("TUTORIAL_PROGRESS", string.Empty);

        if (!string.IsNullOrEmpty(textData))
        {
            data = JsonMapper.ToObject <TutorialProgress>(textData);
        }
        else
        {
            ResetData();
        }
    }
Пример #11
0
 public void Clear()
 {
     // result
     result_ = 0;
     // sessionId
     sessionId_ = 0;
     // serverTimestamp
     serverTimestamp_ = 0;
     // assignedLsAddr
     assignedLsAddr_.Clear();
     // progress
     progress_ = 0;
 }
    // Update is called once per frame
    private void Update()
    {
        //Determines the current stage of the tutorial dependant on conditions
        int curScore = gameController.GetComponent <GameController>().getScore();

        switch (CurState)
        {
        case TutorialProgress.Initialise:    //intro
            Invoke("activateTriggers", 5);
            CurState = TutorialProgress.Collection;
            break;

        case TutorialProgress.Collection:    //Collect 3 objects
            if (triggerCounter == 3)
            {
                CurState = TutorialProgress.LevelStart;
            }
            break;

        case TutorialProgress.LevelStart:    //Asteroids (Reach score)
            if (waitTime <= 0)
            {
                PlayerPrefs.SetInt("PlayerHealth", playerHealth);
                PlayerPrefs.SetInt("PlayerScore", playerScore);
                gameController.SetActive(true);
                ObjectivePrompt.text = "Objective: Press SPACE to fire photons to destroy all Asteroids! Change Weapons using 'Q' to switch to Spread and Rapid Fire";

                if (curScore >= maxScore)
                {
                    CurState = TutorialProgress.LevelEnd;
                }
            }
            else
            {
                waitTime -= Time.deltaTime;
            }
            break;

        case TutorialProgress.LevelEnd:    //Level Over Score reached
            bool status = true;
            PlayerPrefs.SetInt("PlayerScore", curScore);
            PlayerPrefs.SetString("Username", username);
            gameController.GetComponent <GameController>().setObjectiveComplete(status);
            ObjectivePrompt.text = "Objective: Follow the Arrow to your next destination";

            NextLevelPrompt.SetActive(true);
            break;
        }
    }
Пример #13
0
    protected override IEnumerator EventSequence()
    {
        if (!TutorialProgress.MechanicIsLearned(TutorialProgress.Mechanic.Attacking) && controlsHint != null)
        {
            Tween.Stop(controlsHint.GetInstanceID());
            controlsHint.transform.localPosition = new Vector3(0f, -6.31f, 0f);
            Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.up * 2f, 0.25f, 0f, Tween.EaseInOut);
        }

        enemy.MoveToTarget(endMarker.position.x);
        yield return(new WaitUntil(() => enemy.Dead || enemy.ReachedTarget));

        if (!enemy.Dead)
        {
            PlayerController.Instance.CurrentEnemyTarget = enemy;
            enemy.RaiseWeapon();
            float strikeTimer = 0f;
            while (strikeTimer < telegraphTime && !enemy.Dead)
            {
                strikeTimer += Time.deltaTime;
                yield return(new WaitForEndOfFrame());
            }

            if (controlsHint != null)
            {
                Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.up * -3f, 0.25f, 0f, Tween.EaseInOut);
            }

            if (!enemy.Dead)
            {
                enemy.Strike();
                yield return(new WaitForSeconds(0.1f));

                if (!enemy.Dead)
                {
                    Survived = false;
                    PlayerController.Instance.Anim.SetTrigger(playerDeathAnimation);
                    PlayerController.Instance.Die();
                    yield return(new WaitForSeconds(0.3f));

                    yield break;
                }
            }

            yield return(new WaitForSeconds(0.25f));

            TutorialProgress.LearnMechanic(TutorialProgress.Mechanic.Attacking);
        }
    }
Пример #14
0
    void Start()
    {
        tp        = GameObject.Find("Tutorial Manager").GetComponent <TutorialProgress>();
        InfoText  = GameObject.Find("LeftText");
        leftText  = transform.Find("LeftText").GetComponent <TextMeshProUGUI>();
        rightText = transform.Find("RightText").GetComponent <TextMeshProUGUI>();

        RoomInfo = new string[] { "•Let's start off with some <b>movement!</b>\n\n•Use <b>WASD</b> to move.\n\n•Use <b>Space</b> to <b>jump</b>.",
                                  "•You are stealthed when standing on the colour of your team\n\n•You are visible when standing on the colour of the enemy team or on neutral ground.",
                                  "•Press <b>Left Mouse Button</b> to <b>shoot.</b>\n\n•<b>Hold to charge</b> your laser, <b>increasing the range</b> of it.\n\n•You can press <b>Right Mouse Button</b> to <b>cancel</b> your laser.\n\n•Hitting an enemy gives you <b>100 points</b>.",
                                  "•Press <b>Left Shift</b> to <b>dash</b>.\n\n•You can use it either on the ground or in the air.",
                                  "•Press <b>E</b> to use your <b>decoy</b>.\n\n•It will start running in the direction you are facing.\n\n•It will run for 3 seconds.",
                                  "•<b>Collecting orbs</b> give you <b>points</b>.\n\n•Your own coloured orbs and smaller neutral orbs give you <b>50 points</b>.\n\n•The enemy's orbs give <b>100 points</b>.\n\n•The big orb in the center of the room gives you <b>150 points</b>.",
                                  "•Here is an overview of the map!" };
    }
Пример #15
0
 private static string GetFriendlyProgress(TutorialProgress progress)
 {
     switch (progress)
     {
         case TutorialProgress.TutorialAddSampleVideo: return "AddSampleVideo";
         case TutorialProgress.TutorialScanButton: return "ScanButton";
         case TutorialProgress.TutorialHighlightsFound: return "HighlightsFound";
         case TutorialProgress.TutorialBookmarkFlag: return "BookmarkFlag";
         case TutorialProgress.TutorialHandles: return "Handles";
         case TutorialProgress.TutorialShareButton: return "ShareButton";
         case TutorialProgress.TutorialCloseDetails: return "CloseDetails";
         case TutorialProgress.TutorialStartOver: return "StartOver";
         case TutorialProgress.TutorialFinished: return "Finished";
         default: Debug.Assert(false, "Unaccounted case");
             return "";
     }
 }
Пример #16
0
    // Start is called before the first frame update
    void Start()
    {
        if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "02TutorialScene")
        {
            tp = GameObject.FindGameObjectWithTag("UI").GetComponent <TutorialProgress>();
        }

        Button      b     = GetComponent <Button>();
        AudioSource audio = GetComponent <AudioSource>();

        b.onClick.AddListener(delegate() {
            audio.Play();
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "02TutorialScene")
            {
                tp.audioPlayed = true;
            }
        }
                              );
    }
Пример #17
0
        public void SetTutorialProgress(string stepId, bool completed)
        {
            if (!TutorialProgress.ContainsKey(stepId))
            {
                TutorialProgress.Add(stepId, completed);
            }
            else
            {
                TutorialProgress[stepId] = completed;
            }

#if !BACKOFFICE
            if (MetaStateSettings._IsServerAuthoritative)
            {
                CloudScriptMethod cloudScriptMethod = new CloudScriptMethod("SetSetting", false);
                cloudScriptMethod.Params.Add("type", "tutorial");
                cloudScriptMethod.Params.Add("key", stepId);
                cloudScriptMethod.Params.Add("value", completed.ToString());
                PlayFabManager.Instance.AddToStack("Settings", cloudScriptMethod);
            }
#endif
        }
Пример #18
0
    protected override IEnumerator EventSequence()
    {
        bool learnedDucking = TutorialProgress.MechanicIsLearned(TutorialProgress.Mechanic.Ducking);

        if (learnedDucking)
        {
            AudioController.Instance.PlaySound2D("dodge");
            yield return(new WaitForSeconds(0.25f));
        }

        fallingSpear.gameObject.SetActive(true);

        Tween.Position(fallingSpear, landMarker.position, learnedDucking ? 1.1f : 0.75f, 0f, Tween.EaseIn);
        yield return(new WaitForSeconds(learnedDucking ? 0.7f : 0.5f));

        if (!PlayerController.Instance.Ducking)
        {
            Survived = false;
            PlayerController.Instance.Anim.SetTrigger("impale");
            PlayerController.Instance.Die();
            yield return(new WaitForEndOfFrame());

            fallingSpear.gameObject.SetActive(false);
            yield return(new WaitForSeconds(0.3f));

            yield break;
        }

        fallingSpear.GetComponent <SpriteRenderer>().sortingOrder = 5;
        yield return(new WaitForSeconds(learnedDucking ? 0.5f : 0.25f));

        if (!learnedDucking)
        {
            Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.down * 2f, 1f, 0f, Tween.EaseInOut);
            TutorialProgress.LearnMechanic(TutorialProgress.Mechanic.Ducking);
        }

        //embed in ground animation
    }
Пример #19
0
        public void HandleTutorialEndPacket(Client client, Packet packet)
        {
            C2STutorialEndPacket     tutorialEndPacket     = new C2STutorialEndPacket(packet);
            S2CChallengeFinishPacket challengeFinishPacket = new S2CChallengeFinishPacket(true, 1, 1, 2, 10, new List <ItemReward>());

            client.PacketStream.Write(challengeFinishPacket);

            TutorialProgress tutorialProgress = new TutorialProgress();

            tutorialProgress.CharacterId = client.ActiveCharacter.CharacterId;
            tutorialProgress.TutorialId  = tutorialEndPacket.TutorialId;
            tutorialProgress.Success    += Convert.ToInt16(1);
            tutorialProgress.Attempts   += 1;

            var dbTutorialProgressContext = client.DatabaseContext.TutorialProgress.Find(new object[]
                                                                                         { tutorialProgress.CharacterId, tutorialProgress.TutorialId });

            if (dbTutorialProgressContext == null)
            {
                client.DatabaseContext.TutorialProgress.Add(tutorialProgress);
            }
            else
            {
                dbTutorialProgressContext.Success  = tutorialProgress.Success;
                dbTutorialProgressContext.Attempts = tutorialProgress.Attempts;
                client.DatabaseContext.TutorialProgress.Update(dbTutorialProgressContext);
            }

            client.DatabaseContext.SaveChanges();

            List <TutorialProgress> tutorialProgressList = client.DatabaseContext.TutorialProgress
                                                           .Where(q => q.CharacterId == client.Account.Characters[0].CharacterId).ToList();

            client.ActiveCharacter.TutorialProgress = tutorialProgressList;
            S2CTutorialProgressAnswerPacket tutorialProgressAnswerPacket = new S2CTutorialProgressAnswerPacket(tutorialProgressList);

            client.PacketStream.Write(tutorialProgressAnswerPacket);
        }
Пример #20
0
        public bool Deserialize(Stream stream)
        {
            BinaryReader input = new BinaryReader(stream);

            // result
            if (Yippee.Net.Internal.Deserialize(input, out result_) == false)
            {
                return(false);
            }
            // sessionId
            if (Yippee.Net.Internal.Deserialize(input, out sessionId_) == false)
            {
                return(false);
            }
            // serverTimestamp
            if (Yippee.Net.Internal.Deserialize(input, out serverTimestamp_) == false)
            {
                return(false);
            }
            // assignedLsAddr
            if (assignedLsAddr_.Deserialize(stream) == false)
            {
                return(false);
            }
            // progress
            {
                int value = 0;
                if (Yippee.Net.Internal.Deserialize(input, out value) == false)
                {
                    return(false);
                }
                progress_ = (TutorialProgress)value;
            }

            return(true);
        }
Пример #21
0
 public bool DidLoseTutorial(TutorialProgress val)
 {
     object[] objArray1 = new object[] { val };
     return(base.method_11 <bool>("DidLoseTutorial", objArray1));
 }
Пример #22
0
    protected override IEnumerator EventSequence()
    {
        if (!TutorialProgress.MechanicIsLearned(TutorialProgress.Mechanic.Throwing) && controlsHint != null)
        {
            Tween.Stop(controlsHint.GetInstanceID());
            controlsHint.transform.localPosition = new Vector3(0f, -6.31f, 0f);
            Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.up * 2f, 0.25f, 0f, Tween.EaseInOut);
        }

        screamSound = AudioController.Instance.PlaySound2D("enemy_scream").gameObject;
        yield return(new WaitForSeconds(0.2f));

        signal.SetActive(true);
        signal.transform.position = signalStart.position;
        Tween.Position(signal.transform, signalStart.position + new Vector3(-2f, 5f), 0.5f, 0f, Tween.EaseInOut);

        yield return(new WaitForSeconds(0.5f));

        signal.SetActive(false);
        fallingEnemy.gameObject.SetActive(true);

        Tween.Position(fallingEnemy, endMarker.position, fallDuration, 0f, Tween.EaseIn);

        float timer = 0f;

        while (timer < durationUntilImpact && !PlayerController.Instance.Throwing)
        {
            timer += Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }

        if (PlayerController.Instance.Throwing)
        {
            if (controlsHint != null)
            {
                Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.up * -3f, 0.25f, 0f, Tween.EaseInOut);
            }
            TutorialProgress.LearnMechanic(TutorialProgress.Mechanic.Throwing);

            yield return(new WaitForSeconds((durationUntilImpact * durationUntilImpact) - timer));

            Tween.Stop(fallingEnemy.GetInstanceID());
            fallingEnemyAnim.SetTrigger("die");
            Destroy(screamSound);
            AudioController.Instance.PlaySound2D("enemy_scream_short");
            AudioController.Instance.PlaySound2D("misc_crunch_1", pitch: new AudioParams.Pitch(AudioParams.Pitch.Variation.Small));
            CameraEffects.Instance.Shake();
            sortingGroup.sortingOrder = 10;

            Vector2 landingPos = new Vector2(fallingEnemy.position.x, corpseMarker.position.y);
            Tween.Position(fallingEnemy.transform, landingPos, 0.15f, 0.1f, Tween.EaseIn);
            yield return(new WaitForSeconds(0.5f));
        }
        else
        {
            enemyDagger.GetComponent <SpriteRenderer>().enabled = false;
            Survived = false;
            PlayerController.Instance.Anim.SetTrigger("knife");
            PlayerController.Instance.Die();
            yield return(new WaitForSeconds(0.3f));

            if (controlsHint != null)
            {
                Tween.Position(controlsHint.transform, controlsHint.transform.position + Vector3.up * -3f, 0.25f, 0f, Tween.EaseInOut);
            }
        }
    }
Пример #23
0
 public void SetProgress(TutorialProgress value)
 {
     progress_ = value;
 }
Пример #24
0
 public static bool AreAllTutorialsComplete(TutorialProgress progress)
 {
     Class272.Enum20[] enumArray1 = new Class272.Enum20[] { Class272.Enum20.ValueType };
     object[]          objArray1  = new object[] { progress };
     return(MonoClass.smethod_11 <bool>(TritonHs.MainAssemblyPath, "", "GameUtils", "AreAllTutorialsComplete", enumArray1, objArray1));
 }
Пример #25
0
 public static int GetNextTutorial(TutorialProgress progress)
 {
     Class272.Enum20[] enumArray1 = new Class272.Enum20[] { Class272.Enum20.ValueType };
     object[]          objArray1  = new object[] { progress };
     return(MonoClass.smethod_11 <int>(TritonHs.MainAssemblyPath, "", "GameUtils", "GetNextTutorial", enumArray1, objArray1));
 }
Пример #26
0
 private void AssetsVersionCheckCompleted()
 {
     if (!string.IsNullOrEmpty(UpdateManager.Get().GetError()) && UpdateManager.Get().UpdateIsRequired())
     {
         Error.AddFatalLoc("GLUE_PATCHING_ERROR", new object[0]);
     }
     else
     {
         if (Network.ShouldBeConnectedToAurora())
         {
             BnetPresenceMgr.Get().Initialize();
             BnetFriendMgr.Get().Initialize();
             BnetChallengeMgr.Get().Initialize();
             BnetWhisperMgr.Get().Initialize();
             BnetNearbyPlayerMgr.Get().Initialize();
             FriendChallengeMgr.Get().OnLoggedIn();
             SpectatorManager.Get().Initialize();
             if (!Options.Get().GetBool(Option.CONNECT_TO_AURORA))
             {
                 Options.Get().SetBool(Option.CONNECT_TO_AURORA, true);
             }
             TutorialProgress progress = Options.Get().GetEnum <TutorialProgress>(Option.LOCAL_TUTORIAL_PROGRESS);
             if (progress > TutorialProgress.NOTHING_COMPLETE)
             {
                 this.m_waitingForSetProgress = true;
                 ConnectAPI.SetProgress((long)progress);
             }
             if (WebAuth.GetIsNewCreatedAccount())
             {
                 AdTrackingManager.Get().TrackAccountCreated();
                 WebAuth.SetIsNewCreatedAccount(false);
             }
         }
         ConnectAPI.RequestAccountLicenses();
         ConnectAPI.RequestGameLicenses();
         Box.Get().OnLoggedIn();
         BaseUI.Get().OnLoggedIn();
         InactivePlayerKicker.Get().OnLoggedIn();
         HealthyGamingMgr.Get().OnLoggedIn();
         DefLoader.Get().Initialize();
         CollectionManager.Init();
         AdventureProgressMgr.Init();
         Tournament.Init();
         GameMgr.Get().OnLoggedIn();
         if (Network.ShouldBeConnectedToAurora())
         {
             StoreManager.Get().Init();
         }
         Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_LOGIN_FINISHED);
         Network.ResetConnectionFailureCount();
         if (Network.ShouldBeConnectedToAurora())
         {
             ConnectAPI.DoLoginUpdate();
         }
         else
         {
             this.m_waitingForUpdateLoginComplete = false;
         }
         Enum[] args = new Enum[] { PresenceStatus.LOGIN };
         PresenceMgr.Get().SetStatus(args);
         if (SplashScreen.Get() != null)
         {
             SplashScreen.Get().StopPatching();
             SplashScreen.Get().ShowRatings();
         }
         this.PreloadActors();
         if (!Network.ShouldBeConnectedToAurora())
         {
             base.StartCoroutine(this.RegisterScreenWhenReady());
         }
         SceneMgr.Get().LoadShaderPreCompiler();
     }
 }
Пример #27
0
 public void SetTutorialProgress(TutorialProgress val)
 {
     object[] objArray1 = new object[] { val };
     base.method_8("SetTutorialProgress", objArray1);
 }
Пример #28
0
 private void Start()
 {
     progress = GameObject.Find("Tutorial Manager").GetComponent <TutorialProgress>();
 }