Esempio n. 1
0
    public void checkClasses()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        for (int x = 0; x < NewClass1.options.Count; x++)
        {
            if (NewClass1.options[x].text == infoScript.currentClass1)
            {
                NewClass1.options.RemoveAt(x);
                //break;
            }

            for (int y = 0; x < NewClass2.options.Count; y++)
            {
                if (NewClass2.options[y].text == infoScript.currentClass2)
                {
                    NewClass2.options.RemoveAt(y);
                    //break;
                }

                for (int z = 0; z < NewClass3.options.Count; z++)
                {
                    if (NewClass3.options[z].text == infoScript.currentClass3)
                    {
                        NewClass3.options.RemoveAt(z);
                        break;
                    }
                }
            }
        }
    }
Esempio n. 2
0
 public static void AddUniversalInfo(List <UniversalInfo> universalInfoList, ItemBaseInfo itemInfo, int num)
 {
     if (universalInfoList != null)
     {
         var universalInfo = universalInfoList.Find(s => s.HeadID == itemInfo.HeadID);
         if (universalInfo != null)
         {
             universalInfo.UpdateNotify(obj =>
             {
                 universalInfo.Num = MathUtils.Addition(universalInfo.Num, num);
                 return(true);
             }
                                        );
         }
         else
         {
             universalInfo             = new UniversalInfo();
             universalInfo.Name        = itemInfo.ItemName;
             universalInfo.HeadID      = itemInfo.HeadID;
             universalInfo.Num         = num;
             universalInfo.ItemID      = itemInfo.ItemID;
             universalInfo.MaxHeadID   = itemInfo.MaxHeadID;
             universalInfo.ItemDesc    = itemInfo.ItemDesc;
             universalInfo.QualityType = itemInfo.QualityType.ToInt();
             universalInfoList.Add(universalInfo);
         }
     }
 }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        if (numOfQuestions < 1)
        {
            Semester = "Freshman";
        }
        if (numOfQuestions == 3)
        {
            Semester = "Sophmore";
        }
        if (numOfQuestions == 6)
        {
            Semester = "Junior";
        }
        else if (numOfQuestions == 9)
        {
            Semester = "Senior";
        }
        else
        {
            //TestQ.SetActive(false);
        }
        infoScript.updateCurrentSemester(Semester);
    }
Esempio n. 4
0
    public void changeMajor()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.currentMajor = (NewMajor.options[NewMajor.value].text);
    }
Esempio n. 5
0
    public void Sleep()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(10f, 25f, -10f);// once they sleep, their health goes up by 10%, their energy goes up 25%, and stress goes down 10%.
        Escape();
    }
Esempio n. 6
0
    public void Study()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(0f, -25f, -20f);// once they study, their health remains the same, their energy decreases by 25, and their stress is being decreased by 20.
        Escape();
    }
Esempio n. 7
0
    public void VideoGame()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(0f, +25f, -25f); // once they play their video game, their health remains the same, energy increases by 25, and their stress is decreased by 25.
        Escape();
    }
Esempio n. 8
0
    public void Friends()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(10f, -30f, -25f);// once they hang out with friends, their health increases by 10, energy is decreased by 30, and their stress is decreased by 25.
        Escape();
    }
Esempio n. 9
0
    public void changeClasses()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.updateCurrentClasses(NewClass1.options[NewClass1.value].text,
                                        NewClass2.options[NewClass2.value].text,
                                        NewClass3.options[NewClass3.value].text);
    }
Esempio n. 10
0
    public void PregnancyButton()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(-25f, -15f, 40f); //-25 health, -20 energy, +40 stress

        Escape();
    }
Esempio n. 11
0
    public void UpdateGPA()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        StudentGPA = (((1.0 * CorrectAnsw) * 4.0) / (1.0 * numOfQuestions));
        StudentGPA = System.Math.Round(StudentGPA, 2);
        infoScript.updateGPA(StudentGPA);
    }
Esempio n. 12
0
    public void TakeMeds()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(30f, 15f, 0f); // +30 health, +15 energy, stress not changed

        Escape();
    }
Esempio n. 13
0
    // Update is called once per frame
    void Update()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        CurrentMajor.text = infoScript.currentMajor;

        checkMajor();
        //checkClasses();
    }
Esempio n. 14
0
    public void ChoiceOption03()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        ChoiceSelected = 3;
        ++numOfQuestions;
        NextQuestion();
        ChangeAnsw();
        infoScript.updateQuest(numOfQuestions);
    }
Esempio n. 15
0
    public void StdTest()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        infoScript.changeGaugePoints(10f, -10f, 50f);// once they sleep, their health, energy, and stress is reseted to full at 100.



        Escape();
    }
Esempio n. 16
0
    public void CorrectAnswer()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        CorrectAnsw++;
        PassedTest.SetActive(true);
        PlayerScore1 += 15;
        infoScript.updateScore(PlayerScore1);
        infoScript.changeGaugePoints(0f, -10f, -15f);
        UpdateGPA();
    }
Esempio n. 17
0
    public void WrongAnswer()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        WrongAnsw++;
        PlayerScore1 -= 10;
        infoScript.updateScore(PlayerScore1);
        infoScript.changeGaugePoints(-10f, -25f, 10f);
        FailedTest.SetActive(true);
        UpdateGPA();
    }
Esempio n. 18
0
    public void checkMajor()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        //Removes your major from the list
        for (int x = 0; x < NewMajor.options.Count; x++)
        {
            if (NewMajor.options[x].text == infoScript.currentMajor)
            {
                NewMajor.options.RemoveAt(x);
                break;
            }
        }
    }
Esempio n. 19
0
    //Update is called once per frames
    void Update()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        //Constantly checking for player information changes every frame in order to display correct information
        currentClass01.text  = infoScript.currentClass1.ToString();
        currentClass02.text  = infoScript.currentClass2.ToString();
        currentClass03.text  = infoScript.currentClass3.ToString();
        currentGPA.text      = infoScript.currentGPA.ToString();
        currentSemester.text = infoScript.currentSemester.ToString();
        currentScore.text    = infoScript.currentScore.ToString();
        //Constantly updating the status of the gauges
        infoScript.updateStatBars();
        RandomOutcomes();
        checkEnd();
    }
Esempio n. 20
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        currentClass01.text  = infoScript.currentClass1.ToString();
        currentClass02.text  = infoScript.currentClass2.ToString();
        currentClass03.text  = infoScript.currentClass3.ToString();
        currentGPA.text      = infoScript.currentGPA.ToString();
        currentSemester.text = infoScript.currentSemester.ToString();
        currentScore.text    = infoScript.currentScore.ToString();

        //Debug info... [can ignore]
        Debug.Log(infoScript.currentClass1);
        Debug.Log(infoScript.currentClass2);
        Debug.Log(infoScript.currentClass3);
        Debug.Log(infoScript.currentSemester);
        Debug.Log(infoScript.currentGPA);
        Debug.Log(infoScript.currentScore);
    }
Esempio n. 21
0
    public void checkEnd()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        if (infoScript.CurrentQuestion == 12 && infoScript.currentScore >= 90)
        {
            GameEnd.SetActive(true);
            GameObject.Find("EndMessage").GetComponent <Text>().text   = "Congrats! You have successfully beaten SiC:TG!";
            GameObject.Find("EndMessage").GetComponent <Text>().color  = Color.green;
            GameObject.Find("ScoreMessage").GetComponent <Text>().text = "You were able to successfully graduate! Good Job!";
        }
        else if (infoScript.CurrentQuestion == 12 && infoScript.currentScore <= 90)
        {
            GameEnd.SetActive(true);
            GameObject.Find("EndMessage").GetComponent <Text>().text   = "You Failed Out";
            GameObject.Find("EndMessage").GetComponent <Text>().color  = Color.red;
            GameObject.Find("ScoreMessage").GetComponent <Text>().text = "You gave it your all but college just wasn't for you... You did not graduate.";
        }
    }
Esempio n. 22
0
        public override bool TakeAction()
        {
            //if (ContextUser.EnergyNum <= 0)
            //{
            //    ErrorCode = LanguageManager.GetLang().ErrorCode;
            //    ErrorInfo = LanguageManager.GetLang().St_EnergyNotEnough;
            //    return false;
            //}
            //if (ContextUser.EnergyNum <= 0 && ContextUser.TempEnergyNum == 0)
            //{
            //    ErrorCode = LanguageManager.GetLang().ErrorCode;
            //    ErrorInfo = LanguageManager.GetLang().St_EnergyNotEnough;
            //    return false;
            //}
            if (ContextUser.UserStatus == UserStatus.SaoDang)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4007_Saodanging;
                return(false);
            }
            if (ContextUser.UseMagicID == 0)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4004_NoUseMagic;
                return(false);
            }
            if (new GameDataCacheSet <UserEmbattle>().FindAll(Uid, m => m.MagicID == ContextUser.UseMagicID).Count == 0)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St4004_EmbattleEmpty;
                return(false);
            }

            //if (ContextUser.TempEnergyNum == 0)
            //{
            //    ErrorCode = LanguageManager.GetLang().ErrorCode;
            //    ErrorInfo = LanguageManager.GetLang().St_EnergyNotEnough;
            //    return false;
            //}

            ContextUser.UserStatus = UserStatus.Combat;
            try
            {
                //触发战斗
                PlotNPCInfo npcInfo = new ConfigCacheSet <PlotNPCInfo>().FindKey(PlotNpcID);

                //原因:碰npc时掉线,再请求战斗详情
                if (npcInfo == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().LoadDataError;
                    return(false);
                }

                //原因:最后一个npc时,清空玩家保存副本
                if (ContextUser.UserExtend != null && ContextUser.UserExtend.MercenarySeq > npcInfo.NpcSeqNo)
                {
                    ContextUser.UserStatus = UserStatus.Normal;
                    ContextUser.UserExtend.UpdateNotify(obj =>
                    {
                        ContextUser.UserExtend.PlotStatusID = 0;
                        ContextUser.UserExtend.PlotNpcID    = -1;
                        ContextUser.UserExtend.MercenarySeq = 1;
                        ContextUser.UserExtend.IsBoss       = false;
                        return(true);
                    });
                    //ErrorCode = LanguageManager.GetLang().ErrorCode;
                    //ErrorInfo = LanguageManager.GetLang().St4011_NoMonster;
                    //return false;
                }

                PlotInfo plotInfo = new ConfigCacheSet <PlotInfo>().FindKey(npcInfo.PlotID);
                if (plotInfo == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().LoadDataError;
                    return(false);
                }

                var cacheSetUserPlot = new GameDataCacheSet <UserPlotPackage>();
                var cacheSetItemInfo = new ShareCacheStruct <ItemBaseInfo>();
                var cacheSet         = new GameDataCacheSet <UserPlotCombat>();
                var userPlotPack     = cacheSetUserPlot.FindKey(ContextUser.UserID);
                var userPlot         = userPlotPack != null?userPlotPack.PlotPackage.Find(s => s.PlotID == npcInfo.PlotID) : null;

                //PlotHelper.IsKill(ContextUser.UserID, plotInfo.PlotID, plotInfo.CityID)
                if (userPlot != null && userPlot.PlotNum >= plotInfo.ChallengeNum)
                {
                    if (plotInfo.PlotType == PlotType.Elite)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St4002_EliteUsed;
                        return(false);
                    }
                    else if (plotInfo.PlotType == PlotType.HeroPlot)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St4002_HeroPlotNum;
                        return(false);
                    }
                }

                //if (userPlot != null && userPlot.ItemList != null)
                //{
                //    userPlot.UpdateNotify(obj =>
                //    {
                //        userPlot.ItemList.Clear();
                //        return true;
                //    });
                //}
                if (npcInfo.NpcSeqNo == 1)
                {
                    userPlot.ItemList.Clear();
                    ContextUser.IsItem = false;
                }
                userPlotCombat = cacheSet.FindKey(ContextUser.UserID, PlotNpcID);
                if (userPlotCombat != null && userPlotCombat.IsWin && ContextUser.UserExtend != null &&
                    PlotNpcID == ContextUser.UserExtend.PlotNpcID && !ContextUser.IsItem)
                {
                    prizeItems = PlotHelper.GetPlotMonsterItems(Uid, npcInfo.PlotNpcID);
                }
                else
                {
                    ISingleCombat plotCombater = CombatFactory.TriggerPlot(ContextUser, PlotNpcID);
                    if (plotCombater == null)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().LoadDataError;
                        return(false);
                    }
                    if (userPlotCombat == null)
                    {
                        userPlotCombat = new UserPlotCombat()
                        {
                            UserID    = ContextUser.UserID,
                            PlotNpcID = PlotNpcID
                        };
                        cacheSet.Add(userPlotCombat, GameEnvironment.CacheUserPeriod);
                        userPlotCombat = cacheSet.FindKey(ContextUser.UserID, PlotNpcID);
                    }
                    userPlotCombat.PlotID     = npcInfo.PlotID;
                    userPlotCombat.CombatDate = DateTime.Now;
                    userPlotCombat.IsWin      = plotCombater.Doing();
                    if (!userPlotCombat.IsWin)
                    {
                        userPlotCombat.OverNum += 1;
                    }
                    ContextUser.IsItem            = npcInfo.NpcSeqNo == 1 ? false : ContextUser.IsItem;
                    combatProcessList             = (CombatProcessContainer)plotCombater.GetProcessResult();
                    userPlotCombat.GeneralNum     = combatProcessList.AttackList.Count;
                    userPlotCombat.GeneralOverNum = GetOverGeneralNum(combatProcessList.AttackList.ToList());
                    //userPlotCombat.CombatProcess = JsonUtils.Serialize(combatProcessList);
                    int generalNum = combatProcessList.DefenseList.FindAll(s => s.LiveNum > 0).Count;
                    if (userPlotCombat.IsWin)
                    {
                        if (ContextUser.UserExtend != null)
                        {
                            ContextUser.UserExtend.UpdateNotify(obj =>
                            {
                                ContextUser.UserExtend.PlotStatusID = npcInfo.PlotID;
                                ContextUser.UserExtend.PlotNpcID    = PlotNpcID;
                                ContextUser.UserExtend.MercenarySeq = MathUtils.Addition(npcInfo.NpcSeqNo, (short)1);
                                ContextUser.UserExtend.IsBoss       = npcInfo.IsBoss; //是否最后一个副本npc
                                return(true);
                            });
                        }
                        //玩家通过一个城市的所有副本时,增加聊天频道系统提示
                        if (userPlot.PlotStatus != PlotStatus.Completed && npcInfo.IsBoss)      //玩家此副本胜利
                        {
                            var city     = new ConfigCacheSet <CityInfo>().FindKey(plotInfo.CityID);
                            var nextPlot = new ConfigCacheSet <PlotInfo>().FindKey(plotInfo.AftPlotID);
                            if (city != null && nextPlot != null && nextPlot.CityID != plotInfo.CityID)            //此城市的最后一个副本
                            {
                                string content = string.Format(LanguageManager.GetLang().St_systemprompts, ContextUser.NickName,
                                                               city.CityName);
                                new TjxChatService().SystemSend(ChatType.World, content);
                            }
                        }
                        PlotHelper.DoPlotPrize(Uid, npcInfo, userPlotCombat, generalNum, out _honourNum);
                        if (npcInfo.NpcSeqNo == 1)
                        {
                            ContextUser.EnergyNum = MathUtils.Subtraction(ContextUser.EnergyNum, ContextUser.TempEnergyNum).ToShort();
                            //原因:刷晶石BUG
                            ContextUser.TempEnergyNum = 0;
                        }
                        if (!ContextUser.IsItem)
                        {
                            prizeItems = PlotHelper.GetPlotMonsterItems(Uid, npcInfo.PlotNpcID);
                        }
                        TaskHelper.KillPlotMonster(Uid, npcInfo.PlotID, PlotNpcID);

                        //var stroyTaskList = new ConfigCacheSet<StoryTaskInfo>().FindAll(s => s.PlotID == plotInfo.AftPlotID);
                        //foreach (var story in stroyTaskList)
                        //{
                        //    var usertask = new GameDataCacheSet<UserTask>().FindKey(ContextUser.UserID, story.PlotID);
                        //    if (usertask != null)
                        //    {
                        PlotHelper.EnablePlot(Uid, plotInfo.AftPlotID);
                        //    }
                        //}

                        if (plotInfo.PlotType == PlotType.Elite)
                        {
                            EliteDailyRestrain(npcInfo);
                            NoviceHelper.ElitePlotFestivalList(ContextUser); //通关精英副本获得奖励
                        }
                        else if (plotInfo.PlotType == PlotType.Kalpa)
                        {
                            KalpaDailyRestrain(npcInfo);
                        }
                        else if (plotInfo.PlotType == PlotType.HeroPlot)
                        {
                            PlotHelper.EnableHeroPlot(ContextUser.UserID, plotInfo.PlotID);
                            PlotHelper.HeroDailyRestrain(ContextUser.UserID, plotInfo.PlotID, plotInfo.CityID);
                        }
                    }
                    else
                    {
                        ContextUser.GeneralAllCount  = 0;
                        ContextUser.GeneralKillCount = 0;
                    }


                    var restrain = new GameDataCacheSet <UserDailyRestrain>().FindKey(Uid);
                    if (restrain != null)
                    {
                        var restrainSet = new ShareCacheStruct <DailyRestrainSet>().FindKey(RestrainType.PlotGoto);
                        if (restrainSet != null)
                        {
                            GotoNum = MathUtils.Subtraction(restrainSet.MaxNum, restrain.Funtion14, 0);
                        }
                    }
                }
                //原因:最后一个npc时,清空玩家保存副本
                if (ContextUser.UserExtend != null && ContextUser.UserExtend.IsBoss)
                {
                    ContextUser.UserExtend.UpdateNotify(obj =>
                    {
                        ContextUser.UserExtend.PlotStatusID = 0;
                        ContextUser.UserExtend.PlotNpcID    = -1;
                        ContextUser.UserExtend.MercenarySeq = 0;
                        ContextUser.UserExtend.IsBoss       = npcInfo.IsBoss;
                        return(true);
                    });
                }

                if (!ContextUser.IsItem)
                {
                    foreach (var prize in prizeItems)
                    {
                        if (prize.Type == 0 && userPlot != null)
                        {
                            var           itemInfo      = cacheSetItemInfo.FindKey(prize.ItemID);
                            UniversalInfo universalInfo = new UniversalInfo();
                            universalInfo.HeadID    = itemInfo != null ? itemInfo.HeadID : string.Empty;
                            universalInfo.ItemID    = itemInfo != null ? itemInfo.ItemID : 0;
                            universalInfo.ItemDesc  = itemInfo != null ? itemInfo.ItemDesc : string.Empty;
                            universalInfo.MaxHeadID = itemInfo != null ? itemInfo.MaxHeadID : string.Empty;
                            universalInfo.Name      = itemInfo != null ? itemInfo.ItemName : string.Empty;
                            universalInfo.Num       = prize.Num;
                            if (userPlot.ItemList != null && userPlot.ItemList.Count > 0)
                            {
                                var item = userPlot.ItemList.Find(s => s.ItemID == prize.ItemID);
                                if (item != null)
                                {
                                    item.UpdateNotify(obj =>
                                    {
                                        item.Num = MathUtils.Addition(item.Num, prize.Num);
                                        return(true);
                                    });
                                }
                                else
                                {
                                    userPlot.UpdateNotify(obj =>
                                    {
                                        userPlot.ItemList.Add(universalInfo);
                                        return(true);
                                    });
                                }
                            }
                            else
                            {
                                userPlot.UpdateNotify(obj =>
                                {
                                    userPlot.ItemList.Add(universalInfo);
                                    return(true);
                                });
                            }
                        }
                        ContextUser.IsItem = true;
                    }
                }
                var a = userPlot.ItemList;
            }
            finally
            {
                ContextUser.UserStatus = UserStatus.Normal;
            }
            //日志
            UserCombatLog log = new UserCombatLog();

            log.CombatLogID   = Guid.NewGuid().ToString();
            log.UserID        = userPlotCombat.UserID;
            log.CityID        = ContextUser.CityID;
            log.PlotID        = userPlotCombat.PlotID;
            log.NpcID         = userPlotCombat.PlotNpcID;
            log.CombatType    = CombatType.Plot;
            log.HostileUser   = string.Empty;
            log.IsWin         = userPlotCombat.IsWin;
            log.CombatProcess = JsonUtils.Serialize(combatProcessList);
            log.PrizeItem     = prizeItems;
            log.CreateDate    = DateTime.Now;
            var sender = DataSyncManager.GetDataSender();

            sender.Send(log);

            UserHelper.GetGeneralLife(ContextUser.UserID);
            UserHelper.RegainGeneralLife(ContextUser.UserID);

            //var userEmbattleList = EmbattleHelper.CurrEmbattle(ContextUser.UserID, true);
            //           foreach (var userEmbattle in userEmbattleList)
            //           {
            //               _userTalPriority = MathUtils.Addition(_userTalPriority, PriorityHelper.GeneralTotalPriority(ContextUser.UserID, userEmbattle.GeneralID));
            //           }
            selfAbilityEffectList = UserAbilityHelper.GetSelfAbilityEffectList(ContextUser.UserID, 0);
            //var userEmbattleList = EmbattleHelper.CurrEmbattle(ContextUser.UserID, true);

            _userTalPriority = CombatHelper.TotalPriorityNum(ContextUser.UserID, 0);

            return(true);
        }
Esempio n. 23
0
    //This controls and looks for random events to happen in the game
    public void RandomOutcomes()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        //The flu.
        if (infoScript.currentHealthPoints == 80f && infoScript.currentEnergyPoints == 20)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(-25f, 0f, 0f);
            GameObject.Find("Message").GetComponent <Text>().text = "Your health went down because you were diagnosed with the flu.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Health -25";
        }
        // Took a nap.

        if (infoScript.currentEnergyPoints == 50f && infoScript.currentStressPoints == 75f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, 10f, -10f);
            GameObject.Find("Message").GetComponent <Text>().text = "You felt tired and decided to take a nap.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Energy +10 Stress -10";
        }
        // Got a cold


        if (infoScript.currentHealthPoints == 50f && infoScript.currentEnergyPoints == 40f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(-5f, 0f, -20f);
            GameObject.Find("Message").GetComponent <Text>().text = "You got the cold.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Energy +10 Stress -10";
        }

        // Watched avengers

        if (infoScript.currentStressPoints == 60f && infoScript.currentHealthPoints == 100f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, 15f, -10f);
            GameObject.Find("Message").GetComponent <Text>().text = "You saw Avengers with friends.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Energy +15 Stress -10";
        }
        // study for exam.
        if (infoScript.currentStressPoints == 60f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, 0f, 40f);
            GameObject.Find("Message").GetComponent <Text>().text = "Forgot to study for exam.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Stress +40";
        }
        // A lot of homework to do.
        if (infoScript.currentStressPoints == 25f || infoScript.currentEnergyPoints == 60f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, -15f, 15f);
            GameObject.Find("Message").GetComponent <Text>().text = "You have a workload of homework that you have not started yet.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Energy -15 Stress +15";
        }
        // Class cancelled
        if (infoScript.currentEnergyPoints == 50f && infoScript.currentHealthPoints == 65f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, 15f, 0f);
            GameObject.Find("Message").GetComponent <Text>().text = "You class got cancelled due to snow storm.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Energy +15";
        }

        // Anxiety level increases.
        if (infoScript.currentHealthPoints == 75f && infoScript.currentStressPoints == 40f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(-15f, 0f, 25f);
            GameObject.Find("Message").GetComponent <Text>().text = "You have anxiety because your paper due tomorrow and you have not finished it.";
            GameObject.Find("Changes").GetComponent <Text>().text = "Health -10 Stress +25";
        }
        // Gym, you went to work out.
        if (infoScript.currentEnergyPoints == 80f && infoScript.currentHealthPoints == 100f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(15f, -5f, 0f);
            GameObject.Find("Message").GetComponent <Text>().text = "You went to the gym because you were feeling energetic";
            GameObject.Find("Changes").GetComponent <Text>().text = "Health +15 Energy -5";
        }
        // woke up late.
        if (infoScript.currentStressPoints == 55f && infoScript.currentEnergyPoints == 30f)
        {
            Menu.SetActive(true);
            infoScript.changeGaugePoints(0f, 0f, 25f);
            GameObject.Find("Message").GetComponent <Text>().text = "You woke up late for Class!";
            GameObject.Find("Changes").GetComponent <Text>().text = "Stress +25";
        }
    }
Esempio n. 24
0
 public void checkFinAid()
 {
     GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
     UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();
 }
Esempio n. 25
0
    public void changeClassOptions()
    {
        GameObject    gameInfo   = GameObject.Find("UniversalInfoHandler");
        UniversalInfo infoScript = gameInfo.GetComponent <UniversalInfo>();

        GameObject          reg       = GameObject.Find("registrationInfoDump");
        studentRegistration regScript = reg.GetComponent <studentRegistration>();

        NewClass1.ClearOptions();
        NewClass2.ClearOptions();
        NewClass3.ClearOptions();

        switch (infoScript.currentMajor)  //instantiates class choices
        {
        case "Undecided":
            NewClass1.AddOptions(regScript.UndecidedClasses);
            NewClass2.AddOptions(regScript.UndecidedClasses);
            NewClass3.AddOptions(regScript.UndecidedClasses);
            checkClasses();
            break;

        case "Computer Science":
            NewClass1.AddOptions(regScript.CompSciClasses);
            NewClass2.AddOptions(regScript.CompSciClasses);
            NewClass3.AddOptions(regScript.CompSciClasses);
            checkClasses();
            break;

        case "Fine Art":
            NewClass1.AddOptions(regScript.FineArtClasses);
            NewClass2.AddOptions(regScript.FineArtClasses);
            NewClass3.AddOptions(regScript.FineArtClasses);
            checkClasses();
            break;

        case "Engineering":
            NewClass1.AddOptions(regScript.EngineeringClasses);
            NewClass2.AddOptions(regScript.EngineeringClasses);
            NewClass3.AddOptions(regScript.EngineeringClasses);
            checkClasses();
            break;

        case "History":
            NewClass1.AddOptions(regScript.HistoryClasses);
            NewClass2.AddOptions(regScript.HistoryClasses);
            NewClass3.AddOptions(regScript.HistoryClasses);
            checkClasses();
            break;

        case "Buisness":
            NewClass1.AddOptions(regScript.BuisnessClasses);
            NewClass2.AddOptions(regScript.BuisnessClasses);
            NewClass3.AddOptions(regScript.BuisnessClasses);
            checkClasses();
            break;

        case "Gender Studies":
            NewClass1.AddOptions(regScript.GenderClasses);
            NewClass2.AddOptions(regScript.GenderClasses);
            NewClass3.AddOptions(regScript.GenderClasses);
            checkClasses();
            break;
        }
    }