Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #244 from Corvax-Frontier/Up010624
Browse files Browse the repository at this point in the history
Up010624
  • Loading branch information
Vonsant authored Jun 1, 2024
2 parents 3130b59 + 098c606 commit d4de25b
Show file tree
Hide file tree
Showing 341 changed files with 4,609 additions and 1,551 deletions.
7 changes: 7 additions & 0 deletions Content.Server/Explosion/Components/ExplosiveComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ public sealed partial class ExplosiveComponent : Component
[DataField("deleteAfterExplosion")]
public bool? DeleteAfterExplosion;

/// <summary>
/// Whether to not set <see cref="Exploded"/> to true, allowing it to explode multiple times.
/// This should never be used if it is damageable.
/// </summary>
[DataField]
public bool Repeatable;

/// <summary>
/// Avoid somehow double-triggering this explosion (e.g. by damaging this entity from its own explosion.
/// </summary>
Expand Down
25 changes: 25 additions & 0 deletions Content.Server/Explosion/Components/RepeatingTriggerComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Server.Explosion.EntitySystems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.Explosion.Components;

/// <summary>
/// Constantly triggers after being added to an entity.
/// </summary>
[RegisterComponent, Access(typeof(TriggerSystem))]
[AutoGenerateComponentPause]
public sealed partial class RepeatingTriggerComponent : Component
{
/// <summary>
/// How long to wait between triggers.
/// The first trigger starts this long after the component is added.
/// </summary>
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(1);

/// <summary>
/// When the next trigger will be.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextTrigger;
}
2 changes: 1 addition & 1 deletion Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void TriggerExplosive(EntityUid uid, ExplosiveComponent? explosive = null
if (explosive.Exploded)
return;

explosive.Exploded = true;
explosive.Exploded = !explosive.Repeatable;

// Override the explosion intensity if optional arguments were provided.
if (radius != null)
Expand Down
21 changes: 21 additions & 0 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public override void Initialize()
SubscribeLocalEvent<TriggerOnStepTriggerComponent, StepTriggeredOffEvent>(OnStepTriggered);
SubscribeLocalEvent<TriggerOnSlipComponent, SlipEvent>(OnSlipTriggered);
SubscribeLocalEvent<TriggerWhenEmptyComponent, OnEmptyGunShotEvent>(OnEmptyTriggered);
SubscribeLocalEvent<RepeatingTriggerComponent, MapInitEvent>(OnRepeatInit);

SubscribeLocalEvent<SpawnOnTriggerComponent, TriggerEvent>(OnSpawnTrigger);
SubscribeLocalEvent<DeleteOnTriggerComponent, TriggerEvent>(HandleDeleteTrigger);
Expand Down Expand Up @@ -278,6 +279,11 @@ private void OnEmptyTriggered(EntityUid uid, TriggerWhenEmptyComponent component
Trigger(uid, args.EmptyGun);
}

private void OnRepeatInit(Entity<RepeatingTriggerComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextTrigger = _timing.CurTime + ent.Comp.Delay;
}

public bool Trigger(EntityUid trigger, EntityUid? user = null)
{
var triggerEvent = new TriggerEvent(trigger, user);
Expand Down Expand Up @@ -360,6 +366,7 @@ public override void Update(float frameTime)
UpdateProximity();
UpdateTimer(frameTime);
UpdateTimedCollide(frameTime);
UpdateRepeat();
}

private void UpdateTimer(float frameTime)
Expand Down Expand Up @@ -394,5 +401,19 @@ private void UpdateTimer(float frameTime)
_appearance.SetData(uid, TriggerVisuals.VisualState, TriggerVisualState.Unprimed, appearance);
}
}

private void UpdateRepeat()
{
var now = _timing.CurTime;
var query = EntityQueryEnumerator<RepeatingTriggerComponent>();
while (query.MoveNext(out var uid, out var comp))
{
if (comp.NextTrigger > now)
continue;

comp.NextTrigger = now + comp.Delay;
Trigger(uid);
}
}
}
}
1 change: 0 additions & 1 deletion Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<Acc
"Maintenance",
"Medical",
"Mercenary", // Frontier
"Pilot", // Frontier
//"Quartermaster",
//"Research",
//"ResearchDirector",
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Access/Systems/AccessReaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public bool IsAllowed(
return IsAllowedInternal(access, stationKeys, reader);

if (!_containerSystem.TryGetContainer(target, reader.ContainerAccessProvider, out var container))
return false;
return Paused(target); // when mapping, containers with electronics arent spawned

foreach (var entity in container.ContainedEntities)
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Blocking/BlockingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Damage;
using Content.Shared.Examine;
Expand Down Expand Up @@ -209,7 +209,7 @@ public bool StartBlocking(EntityUid item, BlockingComponent component, EntityUid
_fixtureSystem.TryCreateFixture(user,
component.Shape,
BlockingComponent.BlockFixtureID,
hard: true,
hard: false, // Frontier - True to false, mobs AI abuse.
collisionLayer: (int) CollisionGroup.WallLayer,
body: physicsComponent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ private void OnBeforeRangedInteract(Entity<VirtualItemComponent> ent, ref Before
}

#region Hands

/// <summary>
/// Spawns a virtual item in a empty hand
/// </summary>
Expand Down Expand Up @@ -151,7 +150,7 @@ public void DeleteInHandsMatching(EntityUid user, EntityUid matching)
/// </summary>
/// <param name="blockingEnt">The entity we will make a virtual entity copy of</param>
/// <param name="user">The entity that we want to insert the virtual entity</param>
/// <param name="slot">The slot to which we will insert the virtual entity (could be the "shoes" slot, for example)</para
/// <param name="slot">The slot to which we will insert the virtual entity (could be the "shoes" slot, for example)</param>
/// <param name="force">Whether or not to force an equip</param>
public bool TrySpawnVirtualItemInInventory(EntityUid blockingEnt, EntityUid user, string slot, bool force = false)
{
Expand All @@ -173,6 +172,8 @@ public bool TrySpawnVirtualItemInInventory(EntityUid blockingEnt, EntityUid user
/// that's done check if the found virtual entity is a copy of our matching entity,
/// if it is, delete it
/// </summary>
/// <param name="user">The entity that we want to delete the virtual entity from</param>
/// <param name="matching">The entity that made the virtual entity</param>
/// <param name="slotName">Set this param if you have the name of the slot, it avoids unnecessary queries</param>
/// <param name="user">The entity that we want to delete the virtual entity from</param>
/// <param name="matching">The entity that made the virtual entity</param>
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/Preferences/Loadouts/RoleLoadout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ public void EnsureValid(ICommonSession session, IDependencyCollection collection
{
var loadout = loadouts[i];

// Old prototype or otherwise invalid.
if (!protoManager.TryIndex(loadout.Prototype, out var loadoutProto))
{
loadouts.RemoveAt(i);
continue;
}

// Malicious client maybe, check the group even has it.
if (!groupProto.Loadouts.Contains(loadout.Prototype))
{
loadouts.RemoveAt(i);
continue;
}

// Validate the loadout can be applied (e.g. points).
if (!IsValid(session, loadout.Prototype, collection, out _))
{
Expand Down
37 changes: 37 additions & 0 deletions Content.Shared/Weapons/Ranged/Components/ActionGunComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Actions;
using Content.Shared.Weapons.Ranged.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;

namespace Content.Shared.Weapons.Ranged.Components;

/// <summary>
/// Lets you shoot a gun using an action.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(ActionGunSystem))]
public sealed partial class ActionGunComponent : Component
{
/// <summary>
/// Action to create, must use <see cref="ActionGunShootEvent"/>.
/// </summary>
[DataField(required: true)]
public EntProtoId Action = string.Empty;

[DataField]
public EntityUid? ActionEntity;

/// <summary>
/// Prototype of gun entity to spawn.
/// Deleted when this component is removed.
/// </summary>
[DataField(required: true)]
public EntProtoId GunProto = string.Empty;

[DataField]
public EntityUid? Gun;
}

/// <summary>
/// Action event for <see cref="ActionGunComponent"/> to shoot at a position.
/// </summary>
public sealed partial class ActionGunShootEvent : WorldTargetActionEvent;
2 changes: 2 additions & 0 deletions Content.Shared/Weapons/Ranged/Events/ShotAttemptedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Shared.Weapons.Ranged.Components;


namespace Content.Shared.Weapons.Ranged.Events;

/// <summary>
Expand Down
41 changes: 41 additions & 0 deletions Content.Shared/Weapons/Ranged/Systems/ActionGunSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Shared.Actions;
using Content.Shared.Weapons.Ranged.Components;

namespace Content.Shared.Weapons.Ranged.Systems;

public sealed class ActionGunSystem : EntitySystem
{
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedGunSystem _gun = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ActionGunComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ActionGunComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<ActionGunComponent, ActionGunShootEvent>(OnShoot);
}

private void OnMapInit(Entity<ActionGunComponent> ent, ref MapInitEvent args)
{
if (string.IsNullOrEmpty(ent.Comp.Action))
return;

_actions.AddAction(ent, ref ent.Comp.ActionEntity, ent.Comp.Action);
ent.Comp.Gun = Spawn(ent.Comp.GunProto);
}

private void OnShutdown(Entity<ActionGunComponent> ent, ref ComponentShutdown args)
{
if (ent.Comp.Gun is {} gun)
QueueDel(gun);
}

private void OnShoot(Entity<ActionGunComponent> ent, ref ActionGunShootEvent args)
{
if (TryComp<GunComponent>(ent.Comp.Gun, out var gun))
_gun.AttemptShoot(ent, ent.Comp.Gun.Value, gun, args.Target);
}
}

5 changes: 3 additions & 2 deletions Content.Shared/Wieldable/WieldableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ public bool TryWield(EntityUid used, WieldableComponent component, EntityUid use

if (component.WieldSound != null)
_audioSystem.PlayPredicted(component.WieldSound, used, user);

var virtuals = new List<EntityUid>();


var virtuals = new List<EntityUid>();
for (var i = 0; i < component.FreeHandsRequired; i++)
{
if (_virtualItemSystem.TrySpawnVirtualItemInHand(used, user, out var virtualItem, true))
Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/_NF/Jukebox/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["lateraligator.ogg"]
license: "CC-BY-3.0"
copyright: "Later Alligator By Silverman Sound Studios. Converted to mono ogg"
source: "https://soundcloud.com/silvermansound/later-alligator"
Binary file added Resources/Audio/_NF/Jukebox/lateraligator.ogg
Binary file not shown.
41 changes: 41 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4710,3 +4710,44 @@ Entries:
Frontier.
id: 4997
time: '2024-05-31T11:11:02.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: Added more selections to loadouts options! make sure to pick new items!
id: 4998
time: '2024-06-01T12:46:43.0000000+00:00'
- author: Katarn1933
changes:
- type: Add
message: New swampy tune for jukebox
id: 4999
time: '2024-06-01T13:03:59.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Add
message: >-
Added new messenger bags: arcadia, chaplain, chief engineer, contractor,
SR, security, black, blue, green, orange, red, purple, brown, light
brown, white. Most of new messenger bags available through loadouts.
- type: Tweak
message: >-
Resprited some messenger bags a bit (engineering, janitor, cultist, both
NFSD).
id: 5000
time: '2024-06-01T14:44:45.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Fix
message: >-
Mail RPDS, N2554 Pattern Repeater and BB gun no longer turn invisible if
wielded or put in suit storage slot.
id: 5001
time: '2024-06-01T15:17:54.0000000+00:00'
- author: Leander
changes:
- type: Tweak
message: >-
Silver Industries has released the argenti 2.0 with improved chamber and
shooting speed.
id: 5002
time: '2024-06-01T16:30:25.0000000+00:00'
12 changes: 3 additions & 9 deletions Resources/Locale/en-US/_NF/preferences/loadout-groups.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ loadout-group-contractor-face = mask
loadout-group-contractor-utility = tools
loadout-group-contractor-fun = fun
loadout-group-contractor-trinkets = trinkets
# Security

loadout-group-security-guard-jumpsuit = head
loadout-group-security-guard-jumpsuit = jumpsuit
loadout-group-security-guard-gloves = gloves
loadout-group-security-guard-head = head
loadout-group-security-guard-outerclothing = outer clothing
loadout-group-security-guard-shoes = shoes
loadout-group-security-guard-id = ID
loadout-group-contractor-survival-box = survival box
loadout-group-contractor-encryption-key = encryption keys
loadout-group-contractor-implanter = implanters
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/wieldable/wieldable-component.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Locale for wielding items; i.e. two-handing them
### Locale for wielding items; i.e. two-handing them

wieldable-verb-text-wield = Wield
wieldable-verb-text-unwield = Unwield
Expand All @@ -17,4 +17,4 @@ wieldable-component-not-in-hands = { CAPITALIZE(THE($item)) } isn't in your hand
wieldable-component-requires = { CAPITALIZE(THE($item))} must be wielded!
gunwieldbonus-component-examine = This weapon has improved accuracy when wielded.
gunwieldbonus-component-examine = This weapon has improved accuracy when wielded.
1 change: 0 additions & 1 deletion Resources/Prototypes/Access/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- Mail # Frontier
- Medical
- Mercenary # Frontier
- Pilot # Frontier
- Quartermaster
- Salvage
- Cargo
Expand Down
2 changes: 0 additions & 2 deletions Resources/Prototypes/Catalog/Jukebox/Standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@
name: Toby Fox - Undertale
path:
path: /Audio/Jukebox/undertale.ogg


Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
MagazineVector45Practice: 10 #FrontierCorvax
MagazineBoxVector45: 5 #FrontierCorvax
MagazineBoxVector45Practice: 10 #FrontierCorvax
# MagazineBoxLightRifleRubber: 15 # Frontier - TODO: Restore Rubber
MagazineBoxLightRifleRubber: 15
WeaponShotgunDoubleBarreled: 10
WeaponRevolverArgenti: 10
BoxShotgunSlug: 10
BoxLethalshot: 10
BoxBeanbag: 10
BoxShotgunPractice: 10
WeaponRevolverArgenti: 10
MagazineBoxRifle: 10
# MagazineBoxRifleRubber: 15 # Frontier - TODO: Restore Rubber
MagazineBoxRiflePractice: 10
MagazineBoxRifleRubber: 15
MagazineBoxMagnum: 10
SpeedLoaderRifleHeavy: 10
SpeedLoaderRifleHeavyRubber: 10
emaggedInventory:
WeaponPistolViper: 1
Loading

0 comments on commit d4de25b

Please sign in to comment.