Skip to content

Commit

Permalink
Commentary fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Valikzant committed May 11, 2024
1 parent b6edf45 commit eda3b1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ private void HandleExplodeTrigger(EntityUid uid, ExplodeOnTriggerComponent compo
private void HandleFlashTrigger(EntityUid uid, FlashOnTriggerComponent component, TriggerEvent args)
{
// TODO Make flash durations sane ffs.
_flashSystem.FlashArea(uid, args.User, force: false, component.Range, component.Duration * 1000f);
// A-13 force set to false due usage for trigger granades only and to not break balance. - 'PenPlus+'
_flashSystem.FlashArea(uid, args.User, force: false, component.Range, component.Duration * 1000f); // A-13 'force: false' set to false due usage for trigger granades only and to not break balance. - 'PenPlus+'
args.Handled = true;
}

Expand Down
10 changes: 4 additions & 6 deletions Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent a
args.Handled = true;
foreach (var e in args.HitEntities)
{
Flash(e, args.User, comp.ForceFlash, uid, comp.FlashDuration, comp.SlowTo, melee: true);
// A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
Flash(e, args.User, comp.ForceFlash, uid, comp.FlashDuration, comp.SlowTo, melee: true); // A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
}
}

Expand All @@ -74,8 +73,7 @@ private void OnFlashUseInHand(EntityUid uid, FlashComponent comp, UseInHandEvent
return;

args.Handled = true;
FlashArea(uid, args.User, comp.ForceFlash, comp.Range, comp.AoeFlashDuration, comp.SlowTo, true);
// A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
FlashArea(uid, args.User, comp.ForceFlash, comp.Range, comp.AoeFlashDuration, comp.SlowTo, true); // A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
}

private bool UseFlash(EntityUid uid, FlashComponent comp, EntityUid user)
Expand Down Expand Up @@ -121,13 +119,13 @@ public void Flash(EntityUid target,
if (!Resolve(target, ref flashable, false))
return;

if (!force) // A-13 check if flash is forced. - 'PenPlus+'
if (!force) // A-13 check if flash is forced. - 'PenPlus+' start
{
var attempt = new FlashAttemptEvent(target, user, used);
RaiseLocalEvent(target, attempt, true);
if (attempt.Cancelled)
return;
}
} // A-13 check if flash is forced. - 'PenPlus+' end

if (melee)
{
Expand Down
3 changes: 2 additions & 1 deletion Content.Shared/Flash/Components/FlashComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public sealed partial class FlashComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
public float Range { get; set; } = 7f;

// A-13 new variable for component ForceFlash to ignore protection if needed. - 'PenPlus+' start
[DataField("forceFlash")]
[ViewVariables(VVAccess.ReadWrite)]
public bool ForceFlash { get; set; } = false;
// A-13 new variable for component ForceFlash to ignore protection if needed. - 'PenPlus+'
// A-13 new variable for component ForceFlash to ignore protection if needed. - 'PenPlus+' end

[ViewVariables(VVAccess.ReadWrite)]
[DataField("aoeFlashDuration")]
Expand Down

0 comments on commit eda3b1c

Please sign in to comment.