1
This commit is contained in:
@@ -21,5 +21,6 @@ namespace BITFALL
|
|||||||
public int MaxDamage;
|
public int MaxDamage;
|
||||||
public int InitialDamage;
|
public int InitialDamage;
|
||||||
public int AddressId;
|
public int AddressId;
|
||||||
|
public bool IncludeSelf;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -10,14 +10,12 @@ namespace Net.Project.B.Damage
|
|||||||
{
|
{
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
public int InitialDamage { get; }
|
public int InitialDamage { get; }
|
||||||
public int FinalDamage { get; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct DamageData:IDamageData
|
public struct DamageData:IDamageData
|
||||||
{
|
{
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
public int InitialDamage { get; set; }
|
public int InitialDamage { get; set; }
|
||||||
public int FinalDamage { get; set; }
|
|
||||||
}
|
}
|
||||||
public interface IDamageType
|
public interface IDamageType
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,8 @@
|
|||||||
"references": [
|
"references": [
|
||||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
||||||
"GUID:677cd05ca06c46b4395470200b1acdad",
|
"GUID:677cd05ca06c46b4395470200b1acdad",
|
||||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||||
|
"GUID:d8b63aba1907145bea998dd612889d6b"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
@@ -22,13 +22,15 @@ namespace Net.Project.B.Inventory
|
|||||||
public class PlayerEquipmentInventory : IPlayerEquipmentInventory
|
public class PlayerEquipmentInventory : IPlayerEquipmentInventory
|
||||||
{
|
{
|
||||||
private readonly ILogger<PlayerEquipmentInventory> _logger;
|
private readonly ILogger<PlayerEquipmentInventory> _logger;
|
||||||
|
private readonly IPlayerInventory _playerInventory;
|
||||||
|
|
||||||
public IReadOnlyDictionary<int, IRuntimeItem> Items => _items;
|
public IReadOnlyDictionary<int, IRuntimeItem> Items => _items;
|
||||||
private readonly ConcurrentDictionary<int, IRuntimeItem> _items = new();
|
private readonly ConcurrentDictionary<int, IRuntimeItem> _items = new();
|
||||||
|
|
||||||
public PlayerEquipmentInventory(ILogger<PlayerEquipmentInventory> logger)
|
public PlayerEquipmentInventory(ILogger<PlayerEquipmentInventory> logger, IPlayerInventory playerInventory)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
_playerInventory = playerInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public event Action<int, IRuntimeItem> OnItemAdded;
|
public event Action<int, IRuntimeItem> OnItemAdded;
|
||||||
@@ -69,12 +71,23 @@ namespace Net.Project.B.Inventory
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OnItemConsumed?.Invoke(slot, item);
|
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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.LogCritical(e,e.Message);
|
_logger.LogCritical(e,e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
28
Src/Inventory/IPlayerPlateInventory.cs
Normal file
28
Src/Inventory/IPlayerPlateInventory.cs
Normal file
@@ -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<int, IRuntimeItem> Plates { get; }
|
||||||
|
IReadOnlyDictionary<int,int> PlateSlotProviders { get; }
|
||||||
|
public event Action<IRuntimeItem> OnPlateAdded;
|
||||||
|
public event Action<IRuntimeItem> OnPlateRemoved;
|
||||||
|
public event Action<IRuntimeItem> OnPlateDamaged ;
|
||||||
|
public event Action<IRuntimeItem> OnPlateDestroyed ;
|
||||||
|
public event Action<int2,int2> OnPlateSlotsUpdated;
|
||||||
|
public event Action<int2, int2> OnSlotsUpdated;
|
||||||
|
public event Action<int2, int2> 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);
|
||||||
|
}
|
||||||
|
}
|
11
Src/Inventory/IPlayerPlateInventory.cs.meta
Normal file
11
Src/Inventory/IPlayerPlateInventory.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 791b19f96863f7d44b3f12374e2d3097
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -34,7 +34,18 @@ namespace Net.Project.B.Inventory
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="itemId"></param>
|
/// <param name="itemId"></param>
|
||||||
void Drop(int itemId);
|
void Drop(int itemId);
|
||||||
|
/// <summary>
|
||||||
|
/// 使用武器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="itemId"></param>
|
||||||
|
/// <param name="controller"></param>
|
||||||
|
/// <returns></returns>
|
||||||
bool Draw(int itemId,out IPlayerWeaponController controller);
|
bool Draw(int itemId,out IPlayerWeaponController controller);
|
||||||
|
/// <summary>
|
||||||
|
/// 使用主要武器
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
bool DrawPrimaryWeapon();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -20,4 +20,9 @@ namespace Net.Project.B.Mark
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
public class PositionMark:IMarkComponent{}
|
public class PositionMark:IMarkComponent{}
|
||||||
|
[Serializable]
|
||||||
|
public class GeneralMark:IWorldNode
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
8
Src/Summon.meta
Normal file
8
Src/Summon.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cdf340b129ca02649aee9c3115ade4f5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
20
Src/Summon/Net.Project.B.Summon.asmdef
Normal file
20
Src/Summon/Net.Project.B.Summon.asmdef
Normal file
@@ -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
|
||||||
|
}
|
7
Src/Summon/Net.Project.B.Summon.asmdef.meta
Normal file
7
Src/Summon/Net.Project.B.Summon.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 354e5ade848d5be468f1b967fe89d502
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
34
Src/Summon/SummonSystems.cs
Normal file
34
Src/Summon/SummonSystems.cs
Normal file
@@ -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<IRuntimeItem> 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<IRuntimeItem> items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
Src/Summon/SummonSystems.cs.meta
Normal file
11
Src/Summon/SummonSystems.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9950735f06df4eb4c954172390d176df
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -60,4 +60,7 @@ namespace Net.Project.B.UX
|
|||||||
public interface IUXChat:IUXPanel{}
|
public interface IUXChat:IUXPanel{}
|
||||||
public interface IUXLevelUp:IUXPanel{}
|
public interface IUXLevelUp:IUXPanel{}
|
||||||
public interface IUXCraft:IUXPanel{}
|
public interface IUXCraft:IUXPanel{}
|
||||||
|
public interface IUXPlate:IUXPanel{}
|
||||||
|
public interface IUXAirDropBuy:IUXPanel{}
|
||||||
|
public interface IUXPrepositionedStockBuy:IUXPanel{}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user