fix: Reverts GetProtOffset, Adds PreT2A Weapon Damage & PreUOR Armor Durability (#2114)

This commit is contained in:
Bohica 2025-02-06 01:27:40 -08:00 committed by GitHub
parent 51367df0d2
commit 772511d1e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 65 deletions

View file

@ -941,9 +941,12 @@ public abstract partial class BaseWeapon
public int GetDurabilityBonus()
{
var bonus = _quality == WeaponQuality.Exceptional ? 20 : 0;
if (!Core.UOR)
{
return (int)_durabilityLevel * 5 + ((int)_quality - 1) * 10;
}
bonus += _durabilityLevel switch
var bonus = _durabilityLevel switch
{
WeaponDurabilityLevel.Durable => 20,
WeaponDurabilityLevel.Substantial => 50,
@ -955,23 +958,11 @@ public abstract partial class BaseWeapon
if (Core.AOS)
{
bonus += WeaponAttributes.DurabilityBonus;
var resInfo = CraftResources.GetInfo(_resource);
CraftAttributeInfo attrInfo = null;
if (resInfo != null)
{
attrInfo = resInfo.AttributeInfo;
}
if (attrInfo != null)
{
bonus += attrInfo.WeaponDurability;
}
bonus += WeaponAttributes.DurabilityBonus + (resInfo?.AttributeInfo?.WeaponDurability ?? 0);
}
return bonus;
return _quality == WeaponQuality.Exceptional ? bonus + 20 : bonus;
}
public int GetLowerStatReq()
@ -1354,7 +1345,7 @@ public abstract partial class BaseWeapon
theirValue = Math.Max(0.1, defValue + 50.0);
}
var chance = ourValue / (theirValue * 2.0) * 1.0 + (double)bonus / 100;
var chance = ourValue / (theirValue * 2.0) * 1.0 + (double)bonus / 100;;
if (Core.AOS && chance < 0.02)
{
@ -2484,7 +2475,15 @@ public abstract partial class BaseWeapon
*/
if (_damageLevel != WeaponDamageLevel.Regular)
{
damage += 2 * (int)_damageLevel - 1;
// Toward the end of T2A, calculations were changed
if (!Core.T2A)
{
damage += (int)_damageLevel;
}
else
{
damage += 2 * (int)_damageLevel - 1;
}
}
return damage;