diff --git a/Assets/Materials/UI/Map Gravity Lines.mat b/Assets/Materials/UI/Map Gravity Lines.mat index 886f9fb90..d904b859a 100644 --- a/Assets/Materials/UI/Map Gravity Lines.mat +++ b/Assets/Materials/UI/Map Gravity Lines.mat @@ -86,7 +86,7 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _Scale: 4.910362 + - _Scale: 1.33001 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 diff --git a/Assets/Scenes/Main Menu.unity b/Assets/Scenes/Main Menu.unity index 23fd3668d..e6315a752 100644 --- a/Assets/Scenes/Main Menu.unity +++ b/Assets/Scenes/Main Menu.unity @@ -249,7 +249,7 @@ PrefabInstance: - target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e, type: 3} propertyPath: m_AnchoredPosition.x - value: 60.98 + value: 0 objectReference: {fileID: 0} - target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e, type: 3} @@ -1302,8 +1302,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 741153267} - m_LocalRotation: {x: 0.015506903, y: 0.9502416, z: -0.30741313, w: 0.047933225} - m_LocalPosition: {x: -117.51999, y: -77.08743, z: 149.09026} + m_LocalRotation: {x: 0.0155069195, y: 0.9502416, z: -0.30741316, w: 0.047933277} + m_LocalPosition: {x: -117.52002, y: -77.087425, z: 149.09026} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 412917866} @@ -1773,8 +1773,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 965376321} - m_LocalRotation: {x: 0.015506903, y: 0.9502416, z: -0.30741313, w: 0.047933225} - m_LocalPosition: {x: -117.51999, y: -77.08743, z: 149.09026} + m_LocalRotation: {x: 0.0155069195, y: 0.9502416, z: -0.30741316, w: 0.047933277} + m_LocalPosition: {x: -117.52002, y: -77.087425, z: 149.09026} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -2722,7 +2722,7 @@ PrefabInstance: - target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e, type: 3} propertyPath: m_AnchoredPosition.x - value: 55.675 + value: 0 objectReference: {fileID: 0} - target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e, type: 3} diff --git a/Assets/Scripts/Gameplay/Weapons/GuidedProjectileManager.cs b/Assets/Scripts/Gameplay/Weapons/GuidedProjectileManager.cs index 218b1b994..988ab0227 100644 --- a/Assets/Scripts/Gameplay/Weapons/GuidedProjectileManager.cs +++ b/Assets/Scripts/Gameplay/Weapons/GuidedProjectileManager.cs @@ -10,9 +10,9 @@ public class GuidedProjectileManager : InstantWeaponEffectManager public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target) { - if (target == null) return; if(weapon.Data is LauncherData launcher) { + if (target == null) return; var p = ProjectilePrototype.Instantiate(); p.Source = source.transform; p.SourceEntity = source.Entity; @@ -38,7 +38,6 @@ public class GuidedProjectileManager : InstantWeaponEffectManager var p = ProjectilePrototype.Instantiate(); p.Source = source.transform; p.SourceEntity = source.Entity; - p.Target = target.transform; p.Frequency = guidance.DodgeFrequency; var hp = source.Entity.Hardpoints[item.Position.x, item.Position.y]; var barrel = source.GetBarrel(hp); diff --git a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs index 5fccf64c6..02f5a6bf8 100644 --- a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs @@ -74,13 +74,14 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior public InstantWeapon(ItemManager context, InstantWeaponData data, Entity entity, EquippedItem item) : base(context,data,entity,item) { _data = data; + _ammo = data.MagazineSize; } protected void Trigger() { - // If 1 ammo is consumed per burst, perform ammo consumption here + // If 1 ammo is consumed per burst, perform ammo and energy consumption here // UseAmmo returns false when triggering reload; cancel firing if that is the case - if(_data.SingleAmmoBurst && !UseAmmo()) return; + if(_data.SingleAmmoBurst && (!Entity.TryConsumeEnergy(Energy) || !UseAmmo())) return; _burstRemaining = (int) BurstCount; _burstInterval = BurstTime / _burstRemaining; @@ -105,33 +106,34 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior { if (_data.MagazineSize <= 1) return true; - if (_ammo > 0) _ammo--; - else + if (_ammo > 0) { - var hasAmmo = true; - if (_data.AmmoType != Guid.Empty) - { - var cargo = Entity.FindItemInCargo(_data.AmmoType); - if (cargo != null) - { - var item = cargo.ItemsOfType[_data.AmmoType][0]; - if (item is SimpleCommodity simpleCommodity) - cargo.Remove(simpleCommodity, 1); - } - else hasAmmo = false; - } - if(hasAmmo) - { - OnReloadBegin?.Invoke(); - _cooldown = 1; - _coolingDown = true; - _firing = false; - } - _burstRemaining = 0; - return false; + _ammo--; + return true; } + + var hasAmmo = true; + if (_data.AmmoType != Guid.Empty) + { + var cargo = Entity.FindItemInCargo(_data.AmmoType); + if (cargo != null) + { + var item = cargo.ItemsOfType[_data.AmmoType][0]; + if (item is SimpleCommodity simpleCommodity) + cargo.Remove(simpleCommodity, 1); + } + else hasAmmo = false; + } + if(hasAmmo) + { + OnReloadBegin?.Invoke(); + _cooldown = 1; + _coolingDown = true; + _firing = false; + } + _burstRemaining = 0; + return false; - return true; } public override bool Execute(float delta) @@ -139,11 +141,11 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior base.Execute(delta); if (_coolingDown) { - _cooldown -= delta / (_data.AmmoType != Guid.Empty && _ammo == 0 ? _data.ReloadTime : Cooldown); + _cooldown -= delta / (_data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown); if (_cooldown < 0) { _coolingDown = false; - if (_data.AmmoType != Guid.Empty && _ammo == 0) + if (_data.MagazineSize > 0 && _ammo == 0) { _ammo = _data.MagazineSize; OnReloadComplete?.Invoke(); @@ -156,14 +158,13 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior _burstTimer += delta; while (_burstRemaining > 0 && _burstTimer > 0) { - if (!Entity.TryConsumeEnergy(Energy)) + // If multiple ammo is consumed per burst, perform ammo and energy consumption here + // UseAmmo returns false when triggering reload; cancel firing if that is the case + if (!_data.SingleAmmoBurst && (!Entity.TryConsumeEnergy(Energy) || !UseAmmo())) { _burstRemaining = 0; return false; } - // If 1 ammo is consumed per shot in the burst, perform ammo consumption here - // UseAmmo returns false when triggering reload; cancel firing if that is the case - if (!_data.SingleAmmoBurst && !UseAmmo()) return false; _burstRemaining--; _burstTimer -= _burstInterval; diff --git a/GameData/AetherDB.msgpack b/GameData/AetherDB.msgpack index bbc916125..4251f866e 100644 --- a/GameData/AetherDB.msgpack +++ b/GameData/AetherDB.msgpack @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4bfaaecac4a9ba313e48fcfe71939d8208fb26f5e8fa156e1208d3dbaa5606bb -size 69783 +oid sha256:7614cfd2dcf83ffc3f73d98fb6f85e12fb341be330c7bd72460133a5d6f14281 +size 67141 diff --git a/GameData/PlayerSettings.msgpack b/GameData/PlayerSettings.msgpack index c3066274e..ed04ea775 100644 --- a/GameData/PlayerSettings.msgpack +++ b/GameData/PlayerSettings.msgpack @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ec0689c8e2c4a036409e31c7400f1fe0693951f750e3c86f99536365c183708 -size 76785 +oid sha256:f914616fca6c1f79f6b9b03c29056574195127622453e5ad3bac1b1b3db17fae +size 29254