Fix inverse sync of weapon attack for Last Reward
Fix typo for mystery weapon
This commit is contained in:
@@ -10,7 +10,7 @@ WeaponElement = 0
|
||||
WeaponTag = 0
|
||||
SelfDamage = 0
|
||||
SoundEffect = 23
|
||||
Name = "Unidentified Armament."
|
||||
Name = "Unidentified Armament"
|
||||
StatDescription = "Unidentified Armament"
|
||||
FlavorText = ""
|
||||
SpawnRate = 0.5
|
||||
|
||||
@@ -836,12 +836,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
|
||||
private void InverseHPToAttackPowerSync(int obj)
|
||||
{
|
||||
var weapon = (Weapon)EquipmentComponent.EquippedWeapon.Value;
|
||||
if (weapon.WeaponTag == WeaponTag.InverseHPAttackPower)
|
||||
var weaponsWithInverseSync = Inventory.Items.OfType<Weapon>().Where(x => x.WeaponTag == WeaponTag.InverseHPAttackPower);
|
||||
foreach (var weaponToSync in weaponsWithInverseSync)
|
||||
{
|
||||
var equipAtEnd = EquipmentComponent.IsItemEquipped(weaponToSync);
|
||||
var healthPercentage = (HealthComponent.CurrentHP.Value * 10) / HealthComponent.MaximumHP.Value;
|
||||
weapon.SetAttack(10 - healthPercentage);
|
||||
EquipmentComponent.Equip(weapon);
|
||||
weaponToSync.SetAttack(10 - healthPercentage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user