Skip to content

Commit

Permalink
Revert "Merge pull request #142 from Lemirda/valikzant"
Browse files Browse the repository at this point in the history
This reverts commit d66eee1.
  • Loading branch information
13lackHawk committed May 29, 2024
1 parent ca8c9a8 commit 2478e09
Show file tree
Hide file tree
Showing 256 changed files with 37 additions and 3,663 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +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: false' set to false due usage for trigger granades only and to not break balance. - 'PenPlus+'
_flashSystem.FlashArea(uid, args.User, component.Range, component.Duration * 1000f);
args.Handled = true;
}

Expand Down
23 changes: 9 additions & 14 deletions Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +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, uid, comp.FlashDuration, comp.SlowTo, melee: true);
}
}

Expand All @@ -73,7 +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.Range, comp.AoeFlashDuration, comp.SlowTo, true);
}

private bool UseFlash(EntityUid uid, FlashComponent comp, EntityUid user)
Expand Down Expand Up @@ -108,7 +108,6 @@ private bool UseFlash(EntityUid uid, FlashComponent comp, EntityUid user)

public void Flash(EntityUid target,
EntityUid? user,
bool force, // A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
EntityUid? used,
float flashDuration,
float slowTo,
Expand All @@ -119,15 +118,11 @@ public void Flash(EntityUid target,
if (!Resolve(target, ref flashable, false))
return;

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

if (attempt.Cancelled)
return;

if (melee)
{
Expand All @@ -153,7 +148,7 @@ public void Flash(EntityUid target,

}

public void FlashArea(EntityUid source, EntityUid? user, bool force, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null) // A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null)
{
var transform = EntityManager.GetComponent<TransformComponent>(source);
var mapPosition = _transform.GetMapCoordinates(transform);
Expand All @@ -170,7 +165,7 @@ public void Flash(EntityUid target,
continue;

// They shouldn't have flash removed in between right?
Flash(entity, user, force, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity)); // A-13 new variable from component ForceFlash to ignore protection if needed. - 'PenPlus+'
Flash(entity, user, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity));
}

if (sound != null)
Expand Down
6 changes: 0 additions & 6 deletions Content.Shared/Flash/Components/FlashComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ 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+' end

[ViewVariables(VVAccess.ReadWrite)]
[DataField("aoeFlashDuration")]
public int AoeFlashDuration { get; set; } = 2000;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2478e09

Please sign in to comment.