Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
crafter
Browse files Browse the repository at this point in the history
  • Loading branch information
namidaka authored and namidaka committed Jul 27, 2023
1 parent 8ea48c3 commit 302ac19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deploy/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - datadog
# - geoip
# - dotnet
# - crpg-web-api
- crpg-web-api
# - hosts: gameservers
# become: yes
# roles:
Expand Down
2 changes: 1 addition & 1 deletion src/Module.Client/DataExport/ItemExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ private static float ModifyShieldWeight(XmlNode nonHeirloomNode, XmlNode node, I
float.Parse(armorNode.Attributes!["hit_points"].Value)
* float.Parse(armorNode.Attributes!["weapon_length"].Value)
* float.Parse(armorNode.Attributes!["weapon_length"].Value);
return shieldWeightPoints / 440000f;
return shieldWeightPoints / 800000f;
}

private static void ModifyChildHeirloomNodesAttribute(
Expand Down
15 changes: 9 additions & 6 deletions src/Module.Server/Common/Models/CrpgItemValueModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ private float CalculateDamageTypeFactorForThrown(DamageTypes damageType)
{
return damageType switch
{
DamageTypes.Blunt => 3.5f,
DamageTypes.Pierce => 1.75f,
_ => 1.175f,
DamageTypes.Blunt => 1.685f,
DamageTypes.Pierce => 1.262f,
_ => 1.0695f,
};
}

Expand Down Expand Up @@ -353,20 +353,23 @@ private float CalculateTierNonCraftedWeapon(WeaponComponent weaponComponent)
private float CalculateThrownWeaponTier(WeaponComponent weaponComponent)
{
WeaponComponentData weapon = weaponComponent.Weapons.MaxBy(a => a.MaxDataValue);
float heirloomLevel = ItemToHeirloomLevel(weaponComponent.Item);
float damageTypeFactor = CalculateDamageTypeFactorForThrown(weapon.ThrustDamageType == DamageTypes.Invalid ? weapon.SwingDamageType : weapon.ThrustDamageType);
float damageFactor = (float)Math.Pow(damageTypeFactor * weapon.ThrustDamage, 2.4f);
float weightFactor = damageFactor / 6900f / weaponComponent.Item.Weight / (float)Math.Pow(1 + heirloomLevel / 10f, 1f);
float scaler = 4f * 1600000f;
float bonusVsShield = weapon.WeaponFlags.HasFlag(WeaponFlags.BonusAgainstShield) ? 1.10f : 1f;
float canDismount = weapon.WeaponFlags.HasFlag(WeaponFlags.CanDismount) ? 1.10f : 1f;
float tier =
(float)Math.Pow(weapon.ThrustDamage, 2.4f)
damageFactor
* weapon.MissileSpeed
* weapon.Accuracy
* weapon.MaxDataValue
* CalculateDamageTypeFactorForThrown(weapon.ThrustDamageType == DamageTypes.Invalid ? weapon.SwingDamageType : weapon.ThrustDamageType)
* bonusVsShield
* canDismount
* (float) Math.Pow(weightFactor, 0.5f)
/ scaler;

float heirloomLevel = ItemToHeirloomLevel(weaponComponent.Item);
tier /= (float)Math.Pow(1 + heirloomLevel / 10f, 1f);
return tier * tier / 10f;
}
Expand Down

0 comments on commit 302ac19

Please sign in to comment.