Skip to content
Merged

hotfix #1413

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,30 @@ public void StartZombify(EntityUid uid, EntityUid target, BlobPodComponent? comp
if (!Resolve(uid, ref component))
return;

component.ZombifyTarget = target;
_popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-start", ("pod", uid)), target, target,
Shared.Popups.PopupType.LargeCaution);
_popups.PopupEntity(Loc.GetString("blob-mob-zombify-third-start", ("pod", uid), ("target", target)), target,
Filter.PvsExcept(target), true, Shared.Popups.PopupType.LargeCaution);

component.ZombifyStingStream = _audioSystem.PlayPvs(component.ZombifySoundPath, target);
component.IsZombifying = true;

var ev = new BlobPodZombifyDoAfterEvent();
var args = new DoAfterArgs(EntityManager, uid, component.ZombifyDelay, ev, uid, target: target)
{
BreakOnMove = true,
DistanceThreshold = 2f,
NeedHand = false
NeedHand = false,
BreakOnWeightlessMove = false,
};

_doAfter.TryStartDoAfter(args);
if(!_doAfter.TryStartDoAfter(args))
return;

component.ZombifyTarget = target;
_popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-start", ("pod", uid)),
target,
target,
Shared.Popups.PopupType.LargeCaution);
_popups.PopupEntity(Loc.GetString("blob-mob-zombify-third-start", ("pod", uid), ("target", target)),
target,
Filter.PvsExcept(target),
true,
Shared.Popups.PopupType.LargeCaution);

component.ZombifyStingStream = _audioSystem.PlayPvs(component.ZombifySoundPath, target);
component.IsZombifying = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.Rejuvenate;
using Content.Shared.ActionBlocker;
using Content.Server.Popups;
using Content.Server.Stunnable;
using Content.Shared.Backmen.Surgery.Consciousness.Systems;
using Content.Shared.Damage.Systems;
using Content.Shared.Interaction;
Expand All @@ -33,12 +34,17 @@ public sealed class GlimmerWispSystem : EntitySystem
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
[Dependency] private readonly MobStateSystem _mob = default!;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly StunSystem _stun = default!;

private EntityQuery<PsionicComponent> _psiQuery;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<GlimmerWispComponent, GetVerbsEvent<InnateVerb>>(AddDrainVerb);
SubscribeLocalEvent<GlimmerWispComponent, GlimmerWispDrainDoAfterEvent>(OnDrain);

_psiQuery = GetEntityQuery<PsionicComponent>();
}

private void AddDrainVerb(EntityUid uid, GlimmerWispComponent component, GetVerbsEvent<InnateVerb> args)
Expand All @@ -47,7 +53,7 @@ private void AddDrainVerb(EntityUid uid, GlimmerWispComponent component, GetVerb
return;
if (!args.CanAccess)
return;
if (!HasComp<PsionicComponent>(args.Target))
if (!_psiQuery.HasComp(args.Target))
return;
if (!_mob.IsCritical(args.Target))
return;
Expand Down Expand Up @@ -152,25 +158,26 @@ public bool StartLifeDrain(EntityUid uid, EntityUid target, GlimmerWispComponent
if (!Resolve(uid, ref component))
return false;


_popups.PopupEntity(Loc.GetString("life-drain-second-start", ("drainer", uid)), target, target, Shared.Popups.PopupType.LargeCaution);
_popups.PopupEntity(Loc.GetString("life-drain-third-start", ("drainer", uid), ("target", target)), target, Filter.PvsExcept(target), true, Shared.Popups.PopupType.LargeCaution);

component.DrainStingStream = _audioSystem.PlayPvs(component.DrainSoundPath, target);
component.IsDraining = true;

var ev = new GlimmerWispDrainDoAfterEvent();
var args = new DoAfterArgs(EntityManager ,uid, component.DrainDelay, ev, uid, target: target)
{
BreakOnMove = true,
BreakOnDamage = true,
DistanceThreshold = 2f,
NeedHand = false
NeedHand = false,
BreakOnWeightlessMove = false
};

if (!_doAfter.TryStartDoAfter(args, out var id))
return false;

_stun.TryKnockdown(target, TimeSpan.FromSeconds(component.DrainDelay +1), true, false, true, true);
_popups.PopupEntity(Loc.GetString("life-drain-second-start", ("drainer", uid)), target, target, Shared.Popups.PopupType.LargeCaution);
_popups.PopupEntity(Loc.GetString("life-drain-third-start", ("drainer", uid), ("target", target)), target, Filter.PvsExcept(target), true, Shared.Popups.PopupType.LargeCaution);

component.DrainStingStream = _audioSystem.PlayPvs(component.DrainSoundPath, target);
component.IsDraining = true;

component.DoAfter = id;
component.DrainTarget = target;

Expand Down
Binary file modified Resources/Audio/Backmen/Bosses/uriildeath.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@
- type: NPCRetaliation
- type: FactionException
- type: HTN
planCooldown: 10
blackboard:
IdleRange: !type:Single
10
IdleTime: !type:Single
2.0
MinimumIdleTime: !type:Single
1.0
AggroVisionRadius: !type:Single
30.0
RangedRange: !type:Single
15.0
Comment on lines +113 to +124
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Отсутствует MaximumIdleTime в blackboard.

В root.yml (WispIdleCompound) используется maxKey: MaximumIdleTime, но в blackboard определён только MinimumIdleTime. Это приведёт к тому, что RandomOperator не найдёт ключ MaximumIdleTime.

🐛 Предлагаемое исправление
       MinimumIdleTime: !type:Single
         1.0
+      MaximumIdleTime: !type:Single
+        3.0
       AggroVisionRadius: !type:Single
         30.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
planCooldown: 10
blackboard:
IdleRange: !type:Single
10
IdleTime: !type:Single
2.0
MinimumIdleTime: !type:Single
1.0
AggroVisionRadius: !type:Single
30.0
RangedRange: !type:Single
15.0
planCooldown: 10
blackboard:
IdleRange: !type:Single
10
IdleTime: !type:Single
2.0
MinimumIdleTime: !type:Single
1.0
MaximumIdleTime: !type:Single
3.0
AggroVisionRadius: !type:Single
30.0
RangedRange: !type:Single
15.0
🤖 Prompt for AI Agents
In @Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/glimmer_monsters.yml around
lines 113 - 124, The blackboard for this NPC is missing the MaximumIdleTime key
referenced by WispIdleCompound (maxKey: MaximumIdleTime), so RandomOperator will
fail to find it; add a MaximumIdleTime entry to the blackboard in
glimmer_monsters.yml using the same !type:Single format as MinimumIdleTime
(e.g., a value >= MinimumIdleTime) so the RandomOperator/WispIdleCompound can
read maxKey correctly.

rootTask:
task: WispCombatCompound
- type: NpcFactionMember
Expand Down
12 changes: 10 additions & 2 deletions Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/gutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,9 @@
parent: ProjectilePolyboltFly
categories: [ HideSpawnMenu ]
components:
- type: Physics
bodyType: KinematicController
- type: PolymorphOnTrigger
polymorph: GuttermanShooter
targetUser: true
- type: WhitelistTriggerCondition
userWhitelist:
tags:
Expand All @@ -407,6 +406,15 @@
- Impassable
- BulletImpassable
hard: false
fly-by: &flybyfixture
shape: !type:PhysShapeCircle
radius: 1.5
layer:
- Impassable
- MidImpassable
- HighImpassable
- LowImpassable
hard: False

- type: polymorph
id: GuttermanShooter
Expand Down
23 changes: 16 additions & 7 deletions Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@
- tasks:
- !type:HTNCompoundTask
task: DrainPsionicCompound
# - tasks:
# - !type:HTNCompoundTask
# task: IdleCompound
- tasks:
- !type:HTNCompoundTask
task: WispIdleCompound

- type: htnCompound
id: WispRangedCombatCompound
branches:
# Move to target and shoot them if ammo
- preconditions:
- !type:InContainerPrecondition
isInContainer: true
tasks:
- !type:HTNCompoundTask
task: EscapeCompound
- preconditions:
- !type:PulledPrecondition
isPulled: true
tasks:
- !type:HTNPrimitiveTask
operator: !type:UnPullOperator
shutdownState: TaskFinished
- preconditions:
- !type:GunAmmoPrecondition
minPercent: 0.001
tasks:
- !type:HTNCompoundTask
task: GunCombatCompound
- tasks:
- !type:HTNCompoundTask
task: IdleCompound

# Picks a random location for the NPC to move to and idle.
- type: htnCompound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@
lifetime: 0.5
- type: TriggerOnCollide
fixtureID: projectile
# Projectile.DeleteOnCollide is true, but allow this to hit multiple entities if they're
# stacked up (they will all trigger a collide), so this isn't frustrating to use
maxTriggers: 1
- type: PolymorphOnTrigger
polymorph: SwoopFly
targetUser: true
- type: WhitelistTriggerCondition
userWhitelist:
tags:
- BigJohninator
- type: Projectile
damage: {}
- type: Fixtures
fixtures:
projectile:
Expand All @@ -132,6 +138,15 @@
- Impassable
- BulletImpassable
hard: false
fly-by: &flybyfixture
shape: !type:PhysShapeCircle
radius: 1.5
layer:
- Impassable
- MidImpassable
- HighImpassable
- LowImpassable
hard: False

- type: accent
id: BigJohn
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/_Lavaland/Entities/Mobs/Bosses/uriil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@
components:
- type: PolymorphOnTrigger
polymorph: RageUriil
targetUser: true
- type: WhitelistTriggerCondition
userWhitelist:
tags:
Expand All @@ -1310,6 +1311,15 @@
- Impassable
- BulletImpassable
hard: false
fly-by: &flybyfixture
shape: !type:PhysShapeCircle
radius: 1.5
layer:
- Impassable
- MidImpassable
- HighImpassable
- LowImpassable
hard: False
- type: TimedDespawn
lifetime: 40

Expand Down
Loading