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