Skip to content

Instantly share code, notes, and snippets.

@victoraldecoa
Created December 13, 2016 00:47
Show Gist options
  • Save victoraldecoa/e5d36b3a47d71e4b91536e815d3b308d to your computer and use it in GitHub Desktop.
Save victoraldecoa/e5d36b3a47d71e4b91536e815d3b308d to your computer and use it in GitHub Desktop.
Daily Weapon algorithm
_currentDailyWeapon = _possibleWeapons[0];
foreach( var weapon in _possibleWeapons)
{
if(weapon.HardCurrencyCost.HasValue && _currentDailyWeapon.HardCurrencyCost.HasValue)
{
if( weapon.HardCurrencyCost.Value < _currentDailyWeapon.HardCurrencyCost.Value)
_currentDailyWeapon = weapon;
}
else if(weapon.SoftCurrencyCost.HasValue && _currentDailyWeapon.SoftCurrencyCost.HasValue)
{
if( weapon.SoftCurrencyCost.Value < _currentDailyWeapon.SoftCurrencyCost.Value)
_currentDailyWeapon = weapon;
}
else
{
if( weapon.BaseParams.Damage < _currentDailyWeapon.BaseParams.Damage)
_currentDailyWeapon = weapon;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment