示例#1
0
 /// <summary>
 /// This method handles assigning your stats when you either load your stats or equip an item as all stats need to be recalculated when something like this happens.
 /// </summary>
 public void LoadStatsFromItems()
 {
     // current damage = default/base damage + bonus damage + damage from items.
     charStats.SetCurrentDamage(charStats.GetDefaultDamage() + charStats.GetBonusDamage() + (float)(equipment.GetWeaponDamage() + equipment.GetArmourDamage() + equipment.GetRingDamage() + equipment.GetBraceletDamage()));
     // max health = default/base max health + bonus health + health from items.
     charStats.MaxHealth = charStats.GetDefaultMaxHealth() + charStats.GetBonusHealth() + (float)(equipment.GetWeaponHealth() + equipment.GetArmourHealth() + equipment.GetRingHealth() + equipment.GetBraceletHealth());
     // max mana = default/base max mana + bonus mana + mana from item.
     charStats.MaxMana = charStats.GetDefaultMaxMana() + charStats.GetBonusMana() + (float)(equipment.GetWeaponMana() + equipment.GetArmourMana() + equipment.GetRingMana() + equipment.GetBraceletMana());
     // current movement speed = default movement speed + bonus movement speed + movement speed from items.
     charStats.CurrentMoveSpeed = charStats.GetDefaultMoveSpeed() + charStats.GetBonusMoveSpeed() + equipment.GetWeaponMoveSpeed() + equipment.GetArmourMoveSpeed() + equipment.GetRingMoveSpeed() + equipment.GetBraceletMoveSpeed();
 }