Merge branch 'master' into 2021-12-03-remove-IEntity-komm-süsser-todd
# Conflicts: # Content.Client/Crayon/CrayonDecalVisualizer.cs # Content.Client/Tabletop/TabletopSystem.cs # Content.IntegrationTests/Tests/InventoryHelpersTest.cs # Content.Server/AI/EntitySystems/AiSystem.cs # Content.Server/AI/Utility/AiLogic/UtilityAI.cs # Content.Server/AME/AMENodeGroup.cs # Content.Server/Administration/AdminVerbSystem.cs # Content.Server/Body/Systems/RespiratorSystem.cs # Content.Server/Chemistry/Components/InjectorComponent.cs # Content.Server/Chemistry/TileReactions/CleanTileReaction.cs # Content.Server/Chemistry/TileReactions/SpillTileReaction.cs # Content.Server/Crayon/CrayonComponent.cs # Content.Server/Doors/Components/ServerDoorComponent.cs # Content.Server/Explosion/EntitySystems/TriggerSystem.cs # Content.Server/Fluids/Components/MopComponent.cs # Content.Server/Fluids/Components/SpillExtensions.cs # Content.Server/Fluids/EntitySystems/PuddleSystem.cs # Content.Server/Instruments/InstrumentSystem.cs # Content.Server/Nutrition/EntitySystems/DrinkSystem.cs # Content.Server/Nutrition/EntitySystems/FoodSystem.cs # Content.Server/PneumaticCannon/PneumaticCannonSystem.cs # Content.Server/Storage/Components/EntityStorageComponent.cs # Content.Server/Storage/Components/StorageFillComponent.cs # Content.Server/Stunnable/StunbatonSystem.cs # Content.Server/Throwing/ThrowHelper.cs # Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs # Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs # Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs # Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs # Content.Shared/Damage/Components/DamageableComponent.cs # Content.Shared/Damage/Systems/DamageableSystem.cs # Content.Shared/MobState/Components/MobStateComponent.cs # Content.Shared/Slippery/SharedSlipperySystem.cs
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using Content.Server.AI.Components;
|
||||
using Content.Server.AI.EntitySystems;
|
||||
using Content.Server.AI.LoadBalancer;
|
||||
using Content.Server.AI.Operators;
|
||||
using Content.Server.AI.Utility.Actions;
|
||||
@@ -59,33 +60,13 @@ namespace Content.Server.AI.Utility.AiLogic
|
||||
|
||||
private CancellationTokenSource? _actionCancellation;
|
||||
|
||||
/// <summary>
|
||||
/// If we can't do anything then stop thinking; should probably use ActionBlocker instead
|
||||
/// </summary>
|
||||
private bool _isDead;
|
||||
|
||||
/*public void AfterDeserialization()
|
||||
{
|
||||
if (BehaviorSets.Count > 0)
|
||||
{
|
||||
var behaviorManager = IoCManager.Resolve<INpcBehaviorManager>();
|
||||
|
||||
foreach (var bSet in BehaviorSets)
|
||||
{
|
||||
behaviorManager.AddBehaviorSet(this, bSet, false);
|
||||
}
|
||||
|
||||
behaviorManager.RebuildActions(this);
|
||||
}
|
||||
}*/
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
if (BehaviorSets.Count > 0)
|
||||
{
|
||||
var behaviorManager = IoCManager.Resolve<INpcBehaviorManager>();
|
||||
behaviorManager.RebuildActions(this);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseEvent(EventSource.Local, new SleepAiMessage(this, false));
|
||||
EntitySystem.Get<NPCSystem>().WakeNPC(this);
|
||||
}
|
||||
|
||||
base.Initialize();
|
||||
@@ -103,27 +84,6 @@ namespace Content.Server.AI.Utility.AiLogic
|
||||
CurrentAction = null;
|
||||
}
|
||||
|
||||
public void MobStateChanged(MobStateChangedMessage message)
|
||||
{
|
||||
var oldDeadState = _isDead;
|
||||
_isDead = message.Component.IsIncapacitated();
|
||||
|
||||
if (oldDeadState != _isDead)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
switch (_isDead)
|
||||
{
|
||||
case true:
|
||||
entityManager.EventBus.RaiseEvent(EventSource.Local, new SleepAiMessage(this, true));
|
||||
break;
|
||||
case false:
|
||||
entityManager.EventBus.RaiseEvent(EventSource.Local, new SleepAiMessage(this, false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ReceivedAction()
|
||||
{
|
||||
if (_actionRequest == null)
|
||||
|
||||
Reference in New Issue
Block a user