Skip to content

Commit

Permalink
Merge branch 'master' into borg-censorship
Browse files Browse the repository at this point in the history
  • Loading branch information
ewokswagger authored Oct 28, 2024
2 parents 3128c0e + 30dd4eb commit d8b0c83
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 47 deletions.
3 changes: 2 additions & 1 deletion Content.Server/Database/ServerDbPostgres.Notifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ private async Task NotificationListener(CancellationToken cancellationToken)
_notifyLog.Error($"Error in notification listener: {e}");
}
}

_notificationConnection.Dispose();
}

private void OnNotification(object _, NpgsqlNotificationEventArgs notification)
Expand All @@ -116,6 +118,5 @@ public override void Shutdown()
return;

_notificationConnection.Notification -= OnNotification;
_notificationConnection.Dispose();
}
}
29 changes: 29 additions & 0 deletions Content.Server/DeltaV/Tesla/TeslaEnergyBallSystem.PassiveDrain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Content.Server.Tesla.Components;
using Robust.Shared.Timing;

namespace Content.Server.Tesla.EntitySystems;

/// <summary>
/// Manages the passive energy drain for the Tesla.
/// </summary>
public sealed partial class TeslaEnergyBallSystem
{
[Dependency] private readonly IGameTiming _timing = default!;

private static readonly TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);

public override void Update(float frameTime)
{
var curTime = _timing.CurTime;
var query = EntityQueryEnumerator<TeslaEnergyBallComponent>();

while (query.MoveNext(out var uid, out var component))
{
if (curTime < component.NextUpdateTime)
continue;

component.NextUpdateTime = curTime + UpdateInterval;
AdjustEnergy(uid, component, -component.PassiveEnergyDrainRate);
}
}
}
18 changes: 18 additions & 0 deletions Content.Server/Tesla/Components/TeslaEnergyBallComponent.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using Content.Server.Tesla.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; // DeltaV
using Robust.Shared.Timing; // DeltaV

namespace Content.Server.Tesla.Components;

/// <summary>
/// A component that tracks an entity's saturation level from absorbing other creatures by touch, and spawns new entities when the saturation limit is reached.
/// </summary>
[RegisterComponent, Access(typeof(TeslaEnergyBallSystem))]
[AutoGenerateComponentPause] // DeltaV
public sealed partial class TeslaEnergyBallComponent : Component
{
/// <summary>
Expand Down Expand Up @@ -51,4 +54,19 @@ public sealed partial class TeslaEnergyBallComponent : Component
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId ConsumeEffectProto = "EffectTeslaSparks";

// Begin DeltaV additions
/// <summary>
/// The amount of energy drained passively per update.
/// </summary>
[DataField]
public float PassiveEnergyDrainRate = 3f;

/// <summary>
/// The <see cref="IGameTiming.CurTime"/> timespan of next update.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUpdateTime = TimeSpan.Zero;
// End DeltaV
}
2 changes: 1 addition & 1 deletion Content.Server/Tesla/EntitySystem/TeslaEnergyBallSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Content.Server.Tesla.EntitySystems;
/// <summary>
/// A component that tracks an entity's saturation level from absorbing other creatures by touch, and spawns new entities when the saturation limit is reached.
/// </summary>
public sealed class TeslaEnergyBallSystem : EntitySystem
public sealed partial class TeslaEnergyBallSystem : EntitySystem // DeltaV - Change to partial
{
[Dependency] private readonly AudioSystem _audio = default!;

Expand Down
45 changes: 24 additions & 21 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
Entries:
- author: Colin-Tel
changes:
- message: Fixed a few issues with Asterisk, including getting stuck on Epi's park
tree and evac docking at cargo.
type: Fix
id: 124
time: '2023-11-06T15:25:25.0000000+00:00'
- author: FluffiestFloof
changes:
- message: Cyborgs using the Medical model can now print candies with medicine once
again.
type: Add
id: 125
time: '2023-11-06T15:46:56.0000000+00:00'
- author: Colin-Tel
changes:
- message: Salvage Expedition computer boards can now be researched by Epistemics
and produced in circuit imprinters.
type: Add
id: 126
time: '2023-11-07T13:36:49.0000000+00:00'
- author: FluffiestFloof
changes:
- message: Fixed the Reverse Engineering Machine incorrectly decreasing scan power
Expand Down Expand Up @@ -3688,3 +3667,27 @@
id: 623
time: '2024-10-26T01:46:26.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2046
- author: Radezolid
changes:
- message: Fixed being unable to print .38 magazines in an emagged autolathe.
type: Fix
id: 624
time: '2024-10-27T02:58:04.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2052
- author: MilonPL
changes:
- message: Re-added teslas!
type: Add
- message: Tesla now has a random pathfinding and a passive energy drain. Don't
forget to leave the PA on!
type: Tweak
id: 625
time: '2024-10-27T23:05:22.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/1916
- author: Solaris7518
changes:
- message: Cancer mice no longer infest the mail system.
type: Remove
id: 626
time: '2024-10-28T00:25:11.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2061
2 changes: 1 addition & 1 deletion Resources/Credits/GitHub.txt

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Resources/Prototypes/Catalog/Cargo/cargo_engines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
category: cargoproduct-category-name-engineering
group: market

#- type: cargoProduct
# id: EngineTeslaGenerator
# icon:
# sprite: Structures/Power/Generation/Tesla/generator.rsi
# state: icon
# product: CrateEngineeringTeslaGenerator
# cost: 4000
# category: cargoproduct-category-name-engineering
# group: market
- type: cargoProduct
id: EngineTeslaGenerator
icon:
sprite: Structures/Power/Generation/Tesla/generator.rsi
state: icon
product: CrateEngineeringTeslaGenerator
cost: 4000
category: cargoproduct-category-name-engineering
group: market

- type: cargoProduct
id: EngineTeslaCoil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1484,9 +1484,9 @@
- id: MobMouse2
orGroup: Critter
prob: 0.33
- id: MobMouseCancer
orGroup: Critter
prob: 0.01 # Rare
#- id: MobMouseCancer #Delta-V change, This is supposed to be admin only, plus its just stupid. - Solaris
# orGroup: Critter
# prob: 0.01 # Rare

- type: entity
parent: BaseMail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
- type: RandomSpawner
rarePrototypes:
- CrateEngineeringSingularityGenerator
# - CrateEngineeringTeslaGenerator # DeltaV - Teslas aren't allowed
- CrateEngineeringTeslaGenerator
- CrateEngineeringTeslaGroundingRod
- CrateEngineeringParticleAccelerator
- CrateRCD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
- SpeedLoaderSpecialEmpty
- SpeedLoaderSpecialPractice
- MagazineBoxSpecial
- MagazinePistolSpecial
# End of modified code
- type: BlueprintReceiver
whitelist:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
bodyStatus: InAir
sleepingAllowed: false
- type: CanMoveInAir
- type: ChasingWalk
minSpeed: 1
maxSpeed: 3
chasingComponent:
- type: LightningTarget
# - type: ChasingWalk # DeltaV - Replaced with random pathfinding
# minSpeed: 1
# maxSpeed: 3
# chasingComponent:
# - type: LightningTarget
- type: AmbientSound
volume: 3
range: 15
Expand Down Expand Up @@ -83,9 +83,9 @@
shootMaxInterval: 5
shootRange: 7
lightningPrototype: Lightning #To do: change to HyperchargedLightning, after fix beam system
- type: ChasingWalk
minSpeed: 1
maxSpeed: 3
# - type: ChasingWalk # DeltaV - Replaced with random pathfinding
# minSpeed: 1
# maxSpeed: 3
- type: ChaoticJump
jumpMinInterval: 8
jumpMaxInterval: 15
Expand All @@ -108,6 +108,9 @@
interactSuccessString: petting-success-tesla
interactFailureString: petting-failure-tesla
interactSuccessSpawn: EffectHearts
- type: RandomWalk # DeltaV - The tesla here has random pathfinding and dies out as it goes on
maxSpeed: 2
minSpeed: 1

- type: entity
id: TeslaMiniEnergyBall
Expand Down
5 changes: 3 additions & 2 deletions Resources/Prototypes/Research/arsenal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@
state: icon
discipline: Arsenal
tier: 1
cost: 8000
cost: 5000 # DeltaV - Lowered from 8000
recipeUnlocks:
- Truncheon
- TelescopicShield
- HoloprojectorSecurity
- WeaponDisablerSMG
- BorgModuleSecurityDeescalate # Delta-V : SecBorg Research
- BorgModuleSecurityEscalate # Delta-V : SecBorg Research


- type: technology
id: ExplosiveTechnology
Expand Down Expand Up @@ -187,7 +188,7 @@
- PowerCageMedium
- MagazineGrenadeEmpty
- GrenadeFlash
#- GrenadeBlast # DeltaV - no
- GrenadeBlast
- ShuttleGunSvalinnMachineGunCircuitboard
- ShuttleGunPerforatorCircuitboard
- ShuttleGunFriendshipCircuitboard
Expand Down

0 comments on commit d8b0c83

Please sign in to comment.