Redesign and reimplement inventory menu
Add jewels but no implementation yet (needed redesign of inventory menu to function correctly)
This commit is contained in:
@@ -282,6 +282,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
VTComponent.RaiseMaximumVT(equipable.BonusVT, false);
|
||||
|
||||
EquipmentComponent.Equip(equipable);
|
||||
SfxDatabase.Instance.Play(SoundEffect.Equip);
|
||||
|
||||
if (equipable is Weapon weapon && weapon.WeaponTag == WeaponTag.KineticProjectile)
|
||||
PersuaderCrosshair.Show();
|
||||
@@ -293,6 +294,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
VTComponent.SetMaximumVT(VTComponent.MaximumVT.Value - equipable.BonusVT);
|
||||
|
||||
EquipmentComponent.Unequip(equipable);
|
||||
SfxDatabase.Instance.Play(SoundEffect.Unequip);
|
||||
|
||||
if (equipable is Weapon weapon && weapon.WeaponTag == WeaponTag.KineticProjectile)
|
||||
PersuaderCrosshair.Hide();
|
||||
@@ -354,30 +356,30 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
private void HandleProjectile(Weapon weapon)
|
||||
{
|
||||
var ammo = EquipmentComponent.EquippedAmmo.Value as Ammo;
|
||||
if (ammo == null || ammo.Count <= 0)
|
||||
if (ammo.Count == null || ammo.Count?.Value <= 0)
|
||||
return;
|
||||
|
||||
var fired = false;
|
||||
|
||||
if (weapon.WeaponTag == WeaponTag.ElementalProjectile)
|
||||
{
|
||||
var fired = false;
|
||||
if (ammo.AmmoElement == ElementType.Igneous)
|
||||
fired = FireReactor.Fire();
|
||||
if (ammo.AmmoElement == ElementType.Aeolic)
|
||||
fired = AirReactor.Fire();
|
||||
if (ammo.AmmoElement == ElementType.Hydric)
|
||||
fired = WaterReactor.Fire();
|
||||
|
||||
if (!fired)
|
||||
return;
|
||||
}
|
||||
else if (weapon.WeaponTag == WeaponTag.KineticProjectile)
|
||||
{
|
||||
var fired = false;
|
||||
|
||||
if (weapon.WeaponTag == WeaponTag.KineticProjectile)
|
||||
fired = PersuaderBullet.Fire();
|
||||
}
|
||||
|
||||
ammo.SetCount(ammo.Count - 1);
|
||||
if (ammo.Count <= 0)
|
||||
if (!fired)
|
||||
return;
|
||||
|
||||
ammo.SetCount(ammo.Count.Value - 1);
|
||||
EquipmentComponent.UpdateEquipment(ammo);
|
||||
if (ammo.Count.Value <= 0)
|
||||
{
|
||||
EquipmentComponent.Unequip(ammo);
|
||||
Inventory.Remove(ammo);
|
||||
|
||||
Reference in New Issue
Block a user