Ejemplo n.º 1
0
        public void Button_Race(bool isPrev)
        {
            selectRaceID += isPrev ? -1 : 1;
            if (selectRaceID < 0)
            {
                selectRaceID = TRace.Dict.Count - 1;
            }
            else if (selectRaceID >= TRace.Dict.Count)
            {
                selectRaceID = 0;
            }

            if (selectRaceID < Database.Instance.ActivePlayerData.unlockedRaces.Count)
            {
                TRace tRace = Database.Instance.ActivePlayerData.unlockedRaces[selectRaceID].GetTRace();
                raceText.text    = tRace.name;
                raceDesText.text = tRace.description;
                raceFace.sprite  = tRace.face;
                actorAnim.gameObject.SetActive(true);
                actorAnim.Play(tRace.name);
                raceFace.color             = Color.white;
                talentSlots[0].icon.sprite = tRace.relic.sprite;
                skillSlots[2].icon.sprite  = tRace.skill.sprite;
                talentCover.SetActive(false);
            }
            else
            {
                raceText.text    = "LOCKED";
                raceDesText.text = "...";
                talentCover.SetActive(true);
                raceFace.color = Color.black;
                actorAnim.gameObject.SetActive(false);
            }
        }
Ejemplo n.º 2
0
        public void UpdateUI()
        {
            playerName.text = ActivePlayerData.name;
            hpText.text     = ActiveWorldData.HealthPoints + "/" + ActiveWorldData.attribute.maxHealth;
            coinText.text   = ActiveWorldData.coins.ToString();
            expText.text    = ActiveWorldData.exp.ToString();

            skillDeck = (from skillHash in WorldData.ActiveData.learnedSkillHashes select skillHash.GetBaseSkill()).ToList();
            skillDeck.Sort(BaseSkill.CompareByName);
            for (int i = 0; i < skillElements.Length; i++)
            {
                if (i < skillDeck.Count)
                {
                    skillElements[i].gameObject.SetActive(true);
                    skillElements[i].icon.sprite = skillDeck[i].sprite;
                }
                else
                {
                    skillElements[i].gameObject.SetActive(false);
                }
            }
            TRace race = ActiveWorldData.selectRaceID.GetTRaceFromID();

            worldCharacter.m_animator.Play(race.raceName);
            areaCharacter.m_animator.Play(race.raceName);
            characterFace.sprite = race.face;
        }
Ejemplo n.º 3
0
        public PlayerData(string name)
        {
            TRace  defaultRace  = Database.Instance.defaultRace;
            TClass defaultClass = Database.Instance.defaultClass;

            this.name     = name;
            isNewGame     = true;
            totalPlayTime = 0;
            unlockedRaces = new List <int>()
            {
                defaultRace.Hash
            };
            unlockedClasses = new List <int>()
            {
                defaultClass.Hash
            };
            unlockedSkills = new List <int>()
            {
                defaultClass.skillSet[0].Hash,
                defaultClass.skillSet[1].Hash, defaultRace.skill.Hash
            };
            unlockedBuffs = new List <int>()
            {
                defaultRace.relic.Hash, defaultRace.relic.Hash
            };
            unlockedCreatures  = new List <int>();
            unlockedEquipments = new List <int>();
        }
Ejemplo n.º 4
0
        private void DisplaySkillInfoBoard(int slotID)
        {
            if (slotID == 2)
            {
                TRace tRace = Database.Instance.ActivePlayerData.unlockedRaces[selectRaceID].GetTRace();
                infoBoard.UpdateToSkillBoard(tRace.skill.Hash);
            }
            else if (selectClassID < Database.Instance.ActivePlayerData.unlockedClasses.Count)
            {
                TClass tClass = Database.Instance.ActivePlayerData.unlockedClasses[selectClassID].GetTClass();
                infoBoard.UpdateToSkillBoard(tClass.skillSet[slotID].Hash);
            }

            infoBoard.transform.position = skillSlots[slotID].transform.position + new Vector3(0, infoBoardOffsetY, 0);
        }
Ejemplo n.º 5
0
        private void DisplayTalentInfoBoard(int slotID)
        {
            if (slotID == 0)
            {
                TRace tRace = Database.Instance.ActivePlayerData.unlockedRaces[selectRaceID].GetTRace();
                infoBoard.UpdateToRelicBoard(tRace.relic.Hash);
            }
            else if (selectClassID < Database.Instance.ActivePlayerData.unlockedClasses.Count)
            {
                TClass tClass = Database.Instance.ActivePlayerData.unlockedClasses[selectClassID].GetTClass();
                infoBoard.UpdateToRelicBoard(tClass.relic.Hash);
            }

            infoBoard.transform.position = talentSlots[slotID].transform.position + new Vector3(0, infoBoardOffsetY, 0);
        }
Ejemplo n.º 6
0
        public void CreateNewGame(int raceID, int classID)
        {
            m_playerData[SelectSlot].isNewGame = false;
            TRace      tRace     = ActivePlayerData.unlockedRaces[raceID].GetTRace();
            TClass     tClass    = ActivePlayerData.unlockedClasses[classID].GetTClass();
            List <int> skillDeck = new List <int>();

            for (int i = 0; i < 5; i++)
            {
                skillDeck.Add(tClass.skillSet[0].Hash);
            }
            for (int i = 0; i < 4; i++)
            {
                skillDeck.Add(tClass.skillSet[1].Hash);
            }
            skillDeck.Add(tRace.skill.Hash);
            EntityAttribute attribute = (tRace.attribute + tClass.attribute) / 2;

            m_activeWorldData = new WorldData()
            {
                seed              = System.DateTime.Now.ToString(),
                selectClassID     = classID,
                selectRaceID      = raceID,
                attribute         = attribute,
                HealthPoints      = attribute.maxHealth,
                gainedRelicHashes = new List <int>()
                {
                    classID.GetTClassFromID().relic.Hash,
                                              raceID.GetTRaceFromID().relic.Hash
                },
                learnedSkillHashes = skillDeck,
                worldMap           = new List <Location>(),
                stageLocations     = new List <Location>(),
                currentStage       = 0,
                characterLocation  = new Location(4, 0),
                enterAreaDirection = Location.Up,
                worldBound         = new Location(8, -1)
            };
            AreaChunks = new AreaData[0];

            sr = new System.Random(ActiveWorldData.seed.GetStableHashCode());
            //SaveAll();
        }
Ejemplo n.º 7
0
        private void UpdateSummonPage()
        {
            TRace  tRace  = Database.Instance.ActivePlayerData.unlockedRaces[selectRaceID].GetTRace();
            TClass tClass = Database.Instance.ActivePlayerData.unlockedClasses[selectClassID].GetTClass();

            raceFace.sprite  = tRace.face;
            raceText.text    = tRace.name;
            classText.text   = tClass.name;
            raceDesText.text = tRace.description;

            talentSlots[0].icon.sprite = tRace.relic.sprite;
            talentSlots[1].icon.sprite = tClass.relic.sprite;
            skillSlots[0].icon.sprite  = tClass.skillSet[0].sprite;
            skillSlots[1].icon.sprite  = tClass.skillSet[1].sprite;
            skillSlots[2].icon.sprite  = tRace.skill.sprite;
            raceFace.color             = Color.white;

            talentCover.SetActive(false);
            classCover.SetActive(false);
        }