fix: Fixes damage from AR (#1134)

This commit is contained in:
Kamron Batman 2022-07-28 17:39:21 -07:00 • committed by GitHub
parent ce5db11273
commit c4b814cc07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 25 deletions

View file

@ -752,15 +752,10 @@ namespace Server.Items
var halfar = ArmorRating / 2.0; var halfar = ArmorRating / 2.0;
var absorbed = (int)(halfar + halfar * Utility.RandomDouble()); var absorbed = (int)(halfar + halfar * Utility.RandomDouble());
// Don't go below zero damageTaken = Math.Max(0, damageTaken - absorbed);
damageTaken = Math.Min(absorbed, damageTaken);
if (absorbed < 2) // 25% chance to lower durability
{ if (Utility.Random(4) == 0)
absorbed = 2;
}
if (Utility.Random(100) < 25) // 25% chance to lower durability
{ {
if (Core.AOS && ArmorAttributes.SelfRepair > Utility.Random(10)) if (Core.AOS && ArmorAttributes.SelfRepair > Utility.Random(10))
{ {
@ -768,16 +763,7 @@ namespace Server.Items
} }
else else
{ {
int wear; var wear = weapon.Type == WeaponType.Bashing ? Math.Max(1, absorbed / 2) : Utility.Random(2);
if (weapon.Type == WeaponType.Bashing)
{
wear = absorbed / 2;
}
else
{
wear = Utility.Random(2);
}
if (wear > 0 && _maxHitPoints > 0) if (wear > 0 && _maxHitPoints > 0)
{ {
@ -800,11 +786,8 @@ namespace Server.Items
if (Parent is Mobile mobile) if (Parent is Mobile mobile)
{ {
mobile.LocalOverheadMessage( // Your equipment is severely damaged.
MessageType.Regular, mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121);
0x3B2,
1061121
); // Your equipment is severely damaged.
} }
} }
else else

View file

@ -1963,10 +1963,11 @@ namespace Server.Items
} }
} }
var isAcidMonster = m_MaxHits > 0 && MaxRange <= 1 && defender is Slime or AcidElemental;
// Stratics says 50% chance, seems more like 4%.. // Stratics says 50% chance, seems more like 4%..
if (m_MaxHits > 0 && MaxRange <= 1 && defender is Slime or AcidElemental |Utility.RandomDouble() < .04) if (isAcidMonster || Utility.RandomDouble() < 0.04)
{ {
if (MaxRange <= 1 && defender is Slime or AcidElemental) if (isAcidMonster)
{ {
attacker.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500263); // *Acid blood scars your weapon!* attacker.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500263); // *Acid blood scars your weapon!*
} }