Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Remuchi <[email protected]>
Signed-off-by: Timfa <[email protected]>
  • Loading branch information
Timfa2112 and Remuchi authored Feb 2, 2025
1 parent dc30b08 commit 81ab8d5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ public sealed partial class PickNearbyWeldableOperator : HTNOperator
private PathfindingSystem _pathfinding = default!;
private TagSystem _tagSystem = default!;

[DataField("rangeKey")] public string RangeKey = NPCBlackboard.WeldbotWeldRange;
[DataField] public string RangeKey = NPCBlackboard.WeldbotWeldRange;

/// <summary>
/// Target entity to weld
/// </summary>
[DataField("targetKey", required: true)]
[DataField(required: true)]
public string TargetKey = string.Empty;

/// <summary>
/// Target entitycoordinates to move to.
/// </summary>
[DataField("targetMoveKey", required: true)]
[DataField(required: true)]
public string TargetMoveKey = string.Empty;

public override void Initialize(IEntitySystemManager sysManager)
Expand All @@ -59,7 +59,7 @@ public override void Initialize(IEntitySystemManager sysManager)
return (false, null);

var damageQuery = _entManager.GetEntityQuery<DamageableComponent>();
bool emagged = _entManager.HasComponent<EmaggedComponent>(owner);
var emagged = _entManager.HasComponent<EmaggedComponent>(owner);

foreach (var target in _lookup.GetEntitiesInRange(owner, range))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class WeldbotWeldOperator : HTNOperator
/// <summary>
/// Target entity to inject.
/// </summary>
[DataField("targetKey", required: true)]
[DataField(required: true)]
public string TargetKey = string.Empty;

public override void Initialize(IEntitySystemManager sysManager)
Expand Down Expand Up @@ -78,18 +78,14 @@ public override HTNOperatorStatus Update(NPCBlackboard blackboard, float frameTi
if (botComp.IsEmagged)
{
if (!_prototypeManager.TryIndex<DamageGroupPrototype>("Burn", out var prototype))
{
return HTNOperatorStatus.Failed;
}

_damageableSystem.TryChangeDamage(target, new DamageSpecifier(prototype, 10), true, false, damage);
}
else
{
if (!_prototypeManager.TryIndex<DamageGroupPrototype>("Brute", out var prototype))
{
return HTNOperatorStatus.Failed;
}

_damageableSystem.TryChangeDamage(target, new DamageSpecifier(prototype, -50), true, false, damage);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Silicons/Bots/WeldbotComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed partial class WeldbotComponent : Component
/// <summary>
/// Sound played after welding a patient.
/// </summary>
[DataField("weldSound")]
[DataField]
public SoundSpecifier WeldSound = new SoundPathSpecifier("/Audio/Items/welder2.ogg");

public bool IsEmagged = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
doAfter: 2
- tag: WeldingMask
icon:
sprite: Clothing\Head\Welding\welding.rsi
sprite: Clothing/Head/Welding/welding.rsi
state: icon
name: welding mask
doAfter: 2
Expand Down

0 comments on commit 81ab8d5

Please sign in to comment.