Attribute - 416rehman/mythic.obsidian GitHub Wiki

#gameplay/stats The player attributes system involves many values and equations that play a part in how the gameplay feels. Some of these include:

  1. Main Attributes
  2. Attributes
  3. Calculations
  4. Summaries

MainAttributes

The player will have 3 main attributes that will increase as the player levels up, and by Item / Talents / Battlecrys affixes. These mainAttributes trickle down their affects to other player attributes.

  • Strength: Physical power, allowing the player to deal more damage with melee attacks and carry heavier equipment. Each Strengh point increases the player's damage by 10%. Enhances player dealt damage. DEFAULT: 1

  • Dexterity: Player's durability and ability to withstand attacks, reducing the damage they take from enemies and making them harder to kill. Increases Armor attribute by 0.8. DEFAULT: 1

  • Vitality: Overall health, increasing their maximum health and allowing them to survive longer in combat. Increases MaximumLife attribute by 10. DEFAULT: 10

Attributes

These are the detailed attributes of the player and can be increased/decreased by Item / Talents / Battlecrys affixes. Attributes give Diminishing Returns, i.e A player may have 10 Armor, granting them 10% damage reduction, however if the player has 100 Armor, due to diminishing returns they will not have 100% damage reduction.

Some examples include:

  • Life:
    • MaxHealth - Maxium health
    • Health - Current Health (Min: 100, Max: MaxHealth)
    • HealthRegenRate - Percentage of health increased per sec.
    • MaxShield - Maximum Shield
    • Shield - Current Shield (Min: 0, Max: MaxShield)
  • Defense:
    • Armor (reduce damage from same level enemies): Dexterity * ArmorIncreasePerDexterity
    • ArmorIncreasePerDexterity: 0.8%
    • PhysicalResistance: 1
    • ColdResistance: 1
    • FireResistance: 1
    • LightningResistance: 1
    • PoisonResistance: 1
    • BlackMagicResistance: 1
    • StunReduction: 1
    • SlowReduction: 1
    • FreezeReduction: 1
    • EliteDmgReduction: 1
  • Offense:
    • DamageIncreasePerStrength: 8%
    • CriticalHitChance: 5
    • CriticalHitDamage: 50%
    • BonusDamageToElites: 0
    • BonusDmgUsingBow: 0
    • BonusDmgUsingAxe: 0
    • BonusAbilityDmg: 0
    • BonusWeaponDmg: 0
  • Recovery:
    • MaximumLife: Vitality * LifeIncreasePerVitality
    • LifeIncreasePerVitality: 10
    • LifeOnHit: 0
    • LifeOnKill:0
    • LifeRegen:0
  • Tools:
    • PickaxeUseSpeed: 60
    • ScytheUseSpeed: 60
    • HatchetUseSpeed: 60
    • PickaxeYieldBonus: 0%
    • ScytheYieldBonus: 0%
    • HatchetYieldBonus: 0%

Calculations

Hidden calculations, not visible to the player, that are result of an equation involving Base attributes. Used for gameplay purposes. Some examples include

# Can be used when hitting an enemy to determine the damage.
CalculateHitDamage(Item, target):
	BaseHitDamage = RandomInRange(item.dmg.min, item.dmg.max) # items have a dmgMin and dmgMax
	ScaledHitDamage = ScaleToStrength(BaseHitDamage)
	FinalHitDamage = HandleExtraDmg(ScaledHitDamage, Item.type, target)
	return TryApplyCriticalDamage(ScaledHitDamage)

# Scales the dmg to the strength of the character.
ScaleToStrength(Dmg):
	return Dmg + (Strength * (Dmg * DmgIncreasePerStrength))

# Applies extra damage
HandleExtraDmg(Dmg, Target, Using):
	Switch Target:
		Case monster:
			Dmg += ExtraDmgToMonster
		Case ghost:
			# more

	Switch Using:
		Bow:
			Dmg += ExtraDmgUsingBow
		Axe:
			# more

# Applies CritDmg based on CritChance
TryApplyCriticalDamage(Dmg):
	bApplyCrit = getRandomBoolWeight(CriticalHitChance)
	if bApplyCrit:
		return Dmg * (1 + CriticalHitDamage)
	else:
		return Dmg

Summarized Values

Summarized Values use Calculations to show a quick summary of player's most important stats condensed into single values. These cannot be directly modified as these are the results calculations. Includes:

  1. Damage
  2. Toughness
  3. Recovery

1. Damage

Uses the CalculatedAttribute Damage along with the BaseAttributes Critical Hit Chance/Damage, AttackSpeed, All Ability / Battlecry / Runes damage effects.

*DPS is the a summarizedValue specific available on every ability, weapon, battlecry, and rune, through the DPS interface, and is a calcuation of (damage * attack speed) / cooldown?.

AverageOverallDPS = {Ability,Weapon,Battlecry,Rune}.DPS  / {Ability,Weapon,Battlecry,Rune}.size()
AverageOverallDPSScaled = ScaleToStrength(AverageDPS);
return (AverageDPSScaled * (1 + CriticalHitDamage)) * CriticalHitChance

2. Toughness

Summarized value that represents how much damage a player can withstand before dying. It takes into account the player's health, armor, resistances, and dodge chance.

Toughness = (MaximumHealth * (1 + ArmorDamageReduction)) * (1 + Resistances) * (1 - DodgeChance)
  • MaximumHealth is the maximum amount of health the player has.
  • ArmorDamageReduction is the percentage of damage reduced by the player's armor.
  • Resistances is the percentage of damage reduced by the player's resistances.
  • DodgeChance is the chance of dodging an attack. It is represented as a percentage between 0 and 1.

3. Recovery

Recovery is a summarized value that represents how quickly the player can recover health during combat. It takes into account the player's life on hit, life on kill, and health regeneration.

Recovery = (LifeOnHit * HitChance) + (LifeOnKill * KillChance) + HealthRegen
  • LifeOnHit is the amount of health the player regains with each successful hit on an enemy.
  • LifeOnKill is the amount of health the player regains upon killing an enemy.
  • HealthRegen is the amount of health the player regains per second.

Keep in mind

Lack of Damage

There is a Damage attribute, but it is calculated at runtime per attack.

Overall Damage can be increased by increasing the Strength mainAttribute or by increasing the extraDamage attributes (extra damage to {target type}, extra damage using {item}, etc)

⚠️ **GitHub.com Fallback** ⚠️