diff --git a/Src/Bullet/Bullet.cs b/Src/Bullet/Bullet.cs index f39cd27..d0740b6 100644 --- a/Src/Bullet/Bullet.cs +++ b/Src/Bullet/Bullet.cs @@ -21,5 +21,6 @@ namespace BITFALL public int MaxDamage; public int InitialDamage; public int AddressId; + public bool IncludeSelf; } } \ No newline at end of file diff --git a/Src/Damage/IDamageService.cs b/Src/Damage/IDamageService.cs index 779a737..344e7c6 100644 --- a/Src/Damage/IDamageService.cs +++ b/Src/Damage/IDamageService.cs @@ -10,14 +10,12 @@ namespace Net.Project.B.Damage { public int Index { get; set; } public int InitialDamage { get; } - public int FinalDamage { get; } } public struct DamageData:IDamageData { public int Index { get; set; } public int InitialDamage { get; set; } - public int FinalDamage { get; set; } } public interface IDamageType { diff --git a/Src/Inventory/Com.Project.B.Inventory.asmdef b/Src/Inventory/Com.Project.B.Inventory.asmdef index 21a411a..7968e84 100644 --- a/Src/Inventory/Com.Project.B.Inventory.asmdef +++ b/Src/Inventory/Com.Project.B.Inventory.asmdef @@ -4,7 +4,8 @@ "references": [ "GUID:14fe60d984bf9f84eac55c6ea033a8f4", "GUID:677cd05ca06c46b4395470200b1acdad", - "GUID:f51ebe6a0ceec4240a699833d6309b23" + "GUID:f51ebe6a0ceec4240a699833d6309b23", + "GUID:d8b63aba1907145bea998dd612889d6b" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Src/Inventory/IPlayerEquipmentInventory.cs b/Src/Inventory/IPlayerEquipmentInventory.cs index 19230e1..6d73be2 100644 --- a/Src/Inventory/IPlayerEquipmentInventory.cs +++ b/Src/Inventory/IPlayerEquipmentInventory.cs @@ -22,13 +22,15 @@ namespace Net.Project.B.Inventory public class PlayerEquipmentInventory : IPlayerEquipmentInventory { private readonly ILogger _logger; + private readonly IPlayerInventory _playerInventory; public IReadOnlyDictionary Items => _items; private readonly ConcurrentDictionary _items = new(); - public PlayerEquipmentInventory(ILogger logger) + public PlayerEquipmentInventory(ILogger logger, IPlayerInventory playerInventory) { _logger = logger; + _playerInventory = playerInventory; } public event Action OnItemAdded; @@ -69,12 +71,23 @@ namespace Net.Project.B.Inventory try { OnItemConsumed?.Invoke(slot, item); + + foreach (var (id, runtimeItem) in _playerInventory.Container.ItemDictionary) + { + if (runtimeItem.ScriptableId != item.ScriptableId) continue; + if (!_playerInventory.Container.Remove(id)) continue; + if (AddOrUpdate(slot, item)) + { + break; + } + throw new InvalidOperationException("内部错误,无法从背包补充物品"); + } + } catch (Exception e) { _logger.LogCritical(e,e.Message); } - return true; } diff --git a/Src/Inventory/IPlayerPlateInventory.cs b/Src/Inventory/IPlayerPlateInventory.cs new file mode 100644 index 0000000..7cb7d1b --- /dev/null +++ b/Src/Inventory/IPlayerPlateInventory.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using BITKit; +using Unity.Mathematics; +using UnityEngine; + +namespace Net.Project.B.Inventory +{ + public interface IPlayerPlateInventory + { + IReadOnlyDictionary Plates { get; } + IReadOnlyDictionary PlateSlotProviders { get; } + public event Action OnPlateAdded; + public event Action OnPlateRemoved; + public event Action OnPlateDamaged ; + public event Action OnPlateDestroyed ; + public event Action OnPlateSlotsUpdated; + public event Action OnSlotsUpdated; + public event Action OnArmorPointsUpdated; + int2 PlateSlots { get; } + int2 ArmorPoints { get; } + bool AddPlateSlotProvider(int key, int count); + bool RemovePlateSlotProvider(int key); + bool TryAddPlate(IRuntimeItem item); + bool TryRemovePlate(int id); + } +} diff --git a/Src/Inventory/IPlayerPlateInventory.cs.meta b/Src/Inventory/IPlayerPlateInventory.cs.meta new file mode 100644 index 0000000..80a5a58 --- /dev/null +++ b/Src/Inventory/IPlayerPlateInventory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 791b19f96863f7d44b3f12374e2d3097 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Src/Inventory/IPlayerWeaponInventory.cs b/Src/Inventory/IPlayerWeaponInventory.cs index a2e220a..9f3fd09 100644 --- a/Src/Inventory/IPlayerWeaponInventory.cs +++ b/Src/Inventory/IPlayerWeaponInventory.cs @@ -34,7 +34,18 @@ namespace Net.Project.B.Inventory /// /// void Drop(int itemId); + /// + /// 使用武器 + /// + /// + /// + /// bool Draw(int itemId,out IPlayerWeaponController controller); + /// + /// 使用主要武器 + /// + /// + bool DrawPrimaryWeapon(); } } diff --git a/Src/Mark/MarkComponent.cs b/Src/Mark/MarkComponent.cs index 5936f34..a061102 100644 --- a/Src/Mark/MarkComponent.cs +++ b/Src/Mark/MarkComponent.cs @@ -20,4 +20,9 @@ namespace Net.Project.B.Mark #endif } public class PositionMark:IMarkComponent{} + [Serializable] + public class GeneralMark:IWorldNode + { + public string name; + } } diff --git a/Src/Summon.meta b/Src/Summon.meta new file mode 100644 index 0000000..ba96281 --- /dev/null +++ b/Src/Summon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cdf340b129ca02649aee9c3115ade4f5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Src/Summon/Net.Project.B.Summon.asmdef b/Src/Summon/Net.Project.B.Summon.asmdef new file mode 100644 index 0000000..d3b7a7f --- /dev/null +++ b/Src/Summon/Net.Project.B.Summon.asmdef @@ -0,0 +1,20 @@ +{ + "name": "Net.Project.B.Summon", + "rootNamespace": "", + "references": [ + "GUID:14fe60d984bf9f84eac55c6ea033a8f4", + "GUID:f51ebe6a0ceec4240a699833d6309b23", + "GUID:d8b63aba1907145bea998dd612889d6b", + "GUID:677cd05ca06c46b4395470200b1acdad", + "GUID:d750d221812bb1d48baff92e6ef73e28" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": true +} \ No newline at end of file diff --git a/Src/Summon/Net.Project.B.Summon.asmdef.meta b/Src/Summon/Net.Project.B.Summon.asmdef.meta new file mode 100644 index 0000000..7418c0b --- /dev/null +++ b/Src/Summon/Net.Project.B.Summon.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 354e5ade848d5be468f1b967fe89d502 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Src/Summon/SummonSystems.cs b/Src/Summon/SummonSystems.cs new file mode 100644 index 0000000..ed22471 --- /dev/null +++ b/Src/Summon/SummonSystems.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using BITKit; +using BITKit.Entities; +using BITKit.WorldNode; +using Cysharp.Threading.Tasks; +using Unity.Mathematics; + +namespace Net.Project.B.Summon +{ + public interface IAirDropService + { + public UniTask AirDrop(IEntity initiator,float3 position,IReadOnlyList items); + public UniTask AirDrop(IEntity initiator,float3 position, object obj); + } + public interface IAirStrikeService + { + public UniTask AirStrike(IEntity initiator,float3 position); + } + + [Serializable] + public class PrepositionedContainer:IWorldNode + { + + } + + public interface IPrepositionedStockService{ + + public UniTask PrepositionedStock(IEntity initiator, float3 position, IReadOnlyList items); + } +} + + diff --git a/Src/Summon/SummonSystems.cs.meta b/Src/Summon/SummonSystems.cs.meta new file mode 100644 index 0000000..46c71df --- /dev/null +++ b/Src/Summon/SummonSystems.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9950735f06df4eb4c954172390d176df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Src/UX/UXDefine.cs b/Src/UX/UXDefine.cs index 853e907..a1ad5ac 100644 --- a/Src/UX/UXDefine.cs +++ b/Src/UX/UXDefine.cs @@ -60,4 +60,7 @@ namespace Net.Project.B.UX public interface IUXChat:IUXPanel{} public interface IUXLevelUp:IUXPanel{} public interface IUXCraft:IUXPanel{} + public interface IUXPlate:IUXPanel{} + public interface IUXAirDropBuy:IUXPanel{} + public interface IUXPrepositionedStockBuy:IUXPanel{} }