private void showDerived(LHGConsole console, DerivedAttributes derived) { string derivedAsString = string.Format("ap={0} crit={1} hp={2} res={3} acc={4} init={5}", derived.actionPoints, derived.criticalChance, derived.hitPoints, derived.resistance, derived.accuracy, derived.initiative); console.WriteLine(derivedAsString); }
/// <summary> /// Refreshes the hero data displayed on the popup. /// </summary> public void RefreshHeroData() { spriteImage.sprite = GameManager.HeroManager.HeroObject.Icon; var attributes = new DerivedAttributes(GameManager.HeroManager.HeroObject, GameManager.HeroManager.Level); // Attribute text var text = new StringBuilder(); text.Append("Level: "); text.AppendLine(GameManager.HeroManager.Level.ToString()); text.Append("Attack Damage: "); text.AppendLine(attributes.AttackDamage.ToString()); text.Append("Ability Damage: "); text.AppendLine(attributes.AbilityDamage.ToString()); text.Append("Defense: "); text.AppendLine(attributes.Defense.ToString()); text.Append("Health: "); text.AppendLine(attributes.Health.ToString()); text.Append("Health Regen: "); text.AppendLine(attributes.HealthRegeneration.ToString()); text.Append("Energy: "); text.AppendLine(attributes.Energy.ToString()); text.Append("Energy Regen: "); text.AppendLine(attributes.EnergyRegeneration.ToString()); text.Append("Attack Speed: "); text.AppendLine(attributes.AttackSpeed.ToString()); text.Append("Critical Hit Chance: "); text.AppendLine(attributes.CriticalHitChance.ToString()); text.Append("Critical Hit Damage: "); text.AppendLine(attributes.CriticalHitDamage.ToString()); text.Append("Cooldown Reduction: "); text.AppendLine(attributes.CooldownReduction.ToString()); text.Append("Life Drain: "); text.AppendLine(attributes.LifeDrain.ToString()); text.Append("Movement Speed: "); text.AppendLine(attributes.MovementSpeed.ToString()); attributesText.text = text.ToString(); // Upgrade button text text = new StringBuilder(); text.AppendLine("UPGRADE"); text.Append(GameManager.UpgradeHeroCost.ToString()); text.Append(" XP"); upgradeButtonText.text = text.ToString(); upgradeButton.interactable = GameManager.CanUpgradeHero; }
public string GetAttributeNote(AttributeCode attribute) { int baseValue = 0, raceValue = 0, improvementsValue = 0; if (BaseAttributes.ContainsKey(attribute)) { baseValue = BaseAttributes[attribute]; } else if (DerivedAttributes.ContainsKey(attribute)) { baseValue = DerivedAttributes[attribute]; } else { throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute."); } raceValue = Race.GetAttribute(attribute, Female && ApplyGender); return("Rasa(" + raceValue + ") + Úrovně(" + baseValue + ") + Ostatní(" + improvementsValue + ")"); }
public int GetAttribute(AttributeCode attribute) { int baseValue = 0, raceValue, improvementsValue = 0; if (BaseAttributes.ContainsKey(attribute)) { baseValue = BaseAttributes[attribute]; } else if (DerivedAttributes.ContainsKey(attribute)) { baseValue = DerivedAttributes[attribute]; } else { throw new ArgumentOutOfRangeException("Tried to get nonexistent attribute."); } raceValue = Race.GetAttribute(attribute, Female && ApplyGender); return(baseValue + raceValue + improvementsValue); }
/// <summary> /// Creates derived attributes for the enemy. /// </summary> public override void CreateDerivedAttributes() { derivedAttributes = new DerivedAttributes(EnemyObject, Level); }