private static void AddSkillCooldown(Controller current, ESkills skill, int cooldownLength) { current.characterCooldowns.AddCooldownToSkill(skill, cooldownLength); SkillManager skillManager = current.GetComponent <SkillManager>(); if (skillManager != null) { skillManager.RenderSkillCooldowns(); } }
public void AddCooldownToSkill(ESkills skill, int turns) { cooldowns[skill] += turns; }
public EmployeeSkill(Guid employeeId, ESkills skill) { EmployeeId = employeeId; Skill = skill; }
public static EquippableItem GenerateItem(int encounterCount, EquipSlot?slot = null, ESkills skill = ESkills.None, bool guaranteeSkill = false) { float statRollDivisor = 100; if (slot == null) { slot = GetRandomEquipSlot(); } (int, string)rollAndRarity = DecideRarity(); float score = (statScoreBaseValue + encounterCount) * (rollAndRarity.Item1 / statRollDivisor); int numberOfStats = Enum.GetNames(typeof(EStats)).Length; List <float> statRatios = DistributeSumBetweenNRandomNumbers(UnityEngine.Random.Range(1, numberOfStats)); List <float> statRatiosXScore = new List <float>(); // -1 because attack range should not generate random values for (int i = 0; i < numberOfStats - 1; i++) { if (i >= statRatios.Count) { statRatiosXScore.Add(0); } else { statRatiosXScore.Add(Mathf.Floor(statRatios[i] * score)); } } statRatiosXScore.Shuffle(); string category = EquipSlotToSpriteCategory((EquipSlot)slot); string label = GetLabelFromTier(GameManager.instance.GetTier()); Stats itemStats = new Stats(); foreach (EStats stat in EStats.GetValues(typeof(EStats))) { if (stat == EStats.AttackRange) { break; } itemStats.SetStat(stat, statRatiosXScore[(int)stat]); } if (skill == ESkills.None) { skill = RollForSkill(guaranteeSkill); } return(new EquippableItem( slot: (EquipSlot)slot, _name: label, spriteCategoryLabel: (category, label), _sellPrice: (int)Mathf.Ceil(score * 3), itemStats, _itemScore: rollAndRarity.Item1, _rarity: rollAndRarity.Item2, _skill: skill )); }