protected override void SetPrivates() { base.SetPrivates(); CanGoPreviousScene = false; Soul = PlayerPrefsHelper.GetSoul(); _nbCharChoice = Soul.GetStatCurrentValue(Soul.SoulStats[Soul.NbCharChoice_Id]); _choices = new List <Character>(); var maxStartingLevel = Soul.GetStatCurrentValue(Soul.SoulStats[Soul.StartingLevel_Id]); var minStartingLevel = maxStartingLevel - 2 > 1 ? maxStartingLevel - 2 : 1; for (int i = 0; i < _nbCharChoice; ++i) { var tmpChoice = RacesData.GetCharacterFromRaceAndLevel((CharacterRace)Random.Range(0, Helper.EnumCount <CharacterRace>()), Random.Range(minStartingLevel, maxStartingLevel + 1), isPlayer: true); tmpChoice.RunAwayPercent += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.RunAwayPercent_Id]); tmpChoice.LootPercent += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.LootPercent_Id]); tmpChoice.CritChancePercent += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.CritChance_Id]); tmpChoice.InventoryPlace += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.InvPlace_Id]); tmpChoice.InventoryPlace = tmpChoice.InventoryPlace > 6 ? 6 : tmpChoice.InventoryPlace; tmpChoice.WeightLimit += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.InvWeight_Id]); tmpChoice.Gold += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.Gold_Id]); tmpChoice.HpMax += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.Health_Id]); tmpChoice.Hp = Helper.RandomIntMultipleOf(tmpChoice.HpMax / 2, tmpChoice.HpMax, 10); tmpChoice.PmMax += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.Pm_Id]); tmpChoice.PaMax += Soul.GetStatCurrentValue(Soul.SoulStats[Soul.Pa_Id]); _choices.Add(tmpChoice); } Soul.XpKept = (int)(Soul.Xp * Helper.MultiplierFromPercent(0, Soul.GetStatCurrentValue(Soul.SoulStats[Soul.XpKeptPercent_Id]))); Soul.Xp = 0; _skinContainerBhv = GameObject.Find("SkinContainer").GetComponent <SkinContainerBhv>(); _choiceSelector = GameObject.Find("ChoiceSelector"); _characterFrame = GameObject.Find("CharacterFrame"); _playerChoice = _choices[0]; }
protected virtual void SetPrivates() { Application.targetFrameRate = 60; NavigationService.TrySetCurrentRootScene(SceneManager.GetActiveScene().name); Instantiator = GetComponent <Instantiator>(); Soul = PlayerPrefsHelper.GetSoul(); Journey = PlayerPrefsHelper.GetJourney(); }
public void SetPrivates(Character character, AlignmentMerchant alignment, InventoryItemType type, bool isBuying, System.Func <List <InventoryItem>, object> afterManageAction, List <InventoryItem> itemsForSale) { _isBuying = isBuying; _alignment = alignment; _soul = PlayerPrefsHelper.GetSoul(); _character = character; _merchantType = type; _afterManageAction = afterManageAction; _selectedItem = 0; _selectedSprite = transform.Find("SelectedSprite").gameObject; _resetTabPosition = new Vector3(-10.0f, -10.0f, 0.0f); _currentTabPosition = transform.position; _tabs = new List <GameObject>(); _instantiator = GameObject.Find(Constants.GoSceneBhvName).GetComponent <SceneBhv>().Instantiator; for (int i = 0; i < 3; ++i) { _tabs.Add(transform.Find("Tab" + ((InventoryItemType)i).ToString()).gameObject); } _buttonPositive = transform.Find("ButtonPositive").GetComponent <ButtonBhv>().gameObject; _buttonPositiveText = _buttonPositive.transform.GetChild(0).GetComponent <TMPro.TextMeshPro>(); _weightText = transform.Find("Weight").GetComponent <TMPro.TextMeshPro>(); _priceText = transform.Find("ItemPrice").GetComponent <TMPro.TextMeshPro>(); _playerGoldText = transform.Find("PlayerGold").GetComponent <TMPro.TextMeshPro>(); _buttonPriceNPositivePosition = new List <Vector3>(); _buttonPriceNPositivePosition.Add(_priceText.transform.position); _buttonPriceNPositivePosition.Add(_buttonPositive.transform.position); if (_isBuying) { if (itemsForSale == null) { _itemsForSale = PopulateItemsForSale(type); } else { _itemsForSale = itemsForSale; } _items = _itemsForSale; _itemsInventoryPlace = _itemsForSale.Count; } else { _itemsForSale = itemsForSale; _items = _character.Inventory; _itemsInventoryPlace = _character.InventoryPlace; } SetButtons(); }
protected override void SetPrivates() { // DEBUG // RESET //PlayerPrefsHelper.ResetSoul(); // DEBUG // base.SetPrivates(); Soul = PlayerPrefsHelper.GetSoul(); // DEBUG // MOCK VARIABLES //Soul.RunAwayPercent_Level = 5; //Soul.LootPercent_Level = 4; //Soul.CritChance_Level = 3; //Soul.InvPlace_Level = 2; //Soul.InvWeight_Level = 1; //Soul.StartingLevel_Level = 1; //Soul.NbCharChoice_Level = 3; //Soul.Xp = 894; // membres, parfois ça varie // DEBUG // }
protected override void SetPrivates() { base.SetPrivates(); OnRootPreviousScene = Constants.SwipeScene; Soul = PlayerPrefsHelper.GetSoul(); }