Skip to content

Commit

Permalink
Merge branch 'master' into mail-carrier-in-da-hood-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Monotheonist authored Nov 25, 2024
2 parents 4e613e8 + 02f4007 commit ba8a505
Show file tree
Hide file tree
Showing 34 changed files with 279 additions and 100 deletions.
12 changes: 12 additions & 0 deletions Content.Server/Power/Components/ChargerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using Content.Shared.Power;
using Content.Shared.Whitelist;
using Content.Shared.Power;
using Content.Shared.Whitelist;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;

namespace Content.Server.Power.Components
{
Expand All @@ -26,5 +31,12 @@ public sealed partial class ChargerComponent : Component
/// </summary>
[DataField("whitelist")]
public EntityWhitelist? Whitelist;

/// <summary>
/// Indicates whether the charger is portable and thus subject to EMP effects
/// and bypasses checks for transform, anchored, and ApcPowerReceiverComponent.
/// </summary>
[DataField]
public bool Portable = false;
}
}
25 changes: 19 additions & 6 deletions Content.Server/Power/EntitySystems/ChargerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Content.Server.Power.Components;
using Content.Server.Emp;
using Content.Server.PowerCell;
using Content.Shared.Examine;
using Content.Shared.Power;
using Content.Shared.PowerCell.Components;
using Content.Shared.Emp;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using System.Diagnostics.CodeAnalysis;
Expand Down Expand Up @@ -30,6 +32,8 @@ public override void Initialize()
SubscribeLocalEvent<ChargerComponent, ContainerIsInsertingAttemptEvent>(OnInsertAttempt);
SubscribeLocalEvent<ChargerComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
SubscribeLocalEvent<ChargerComponent, ExaminedEvent>(OnChargerExamine);

SubscribeLocalEvent<ChargerComponent, EmpPulseEvent>(OnEmpPulse);
}

private void OnStartup(EntityUid uid, ChargerComponent component, ComponentStartup args)
Expand Down Expand Up @@ -190,18 +194,27 @@ private void UpdateStatus(EntityUid uid, ChargerComponent component)
}
}

private void OnEmpPulse(EntityUid uid, ChargerComponent component, ref EmpPulseEvent args)
{
args.Affected = true;
args.Disabled = true;
}

private CellChargerStatus GetStatus(EntityUid uid, ChargerComponent component)
{
if (!TryComp(uid, out TransformComponent? transformComponent))
return CellChargerStatus.Off;
if (!component.Portable)
{
if (!TryComp(uid, out TransformComponent? transformComponent) || !transformComponent.Anchored)
return CellChargerStatus.Off;
}

if (!transformComponent.Anchored)
if (!TryComp(uid, out ApcPowerReceiverComponent? apcPowerReceiverComponent))
return CellChargerStatus.Off;

if (!TryComp(uid, out ApcPowerReceiverComponent? apcPowerReceiverComponent))
if (!component.Portable && !apcPowerReceiverComponent.Powered)
return CellChargerStatus.Off;

if (!apcPowerReceiverComponent.Powered)
if (HasComp<EmpDisabledComponent>(uid))
return CellChargerStatus.Off;

if (!_container.TryGetContainer(uid, component.SlotId, out var container))
Expand All @@ -218,7 +231,7 @@ private CellChargerStatus GetStatus(EntityUid uid, ChargerComponent component)

return CellChargerStatus.Charging;
}

private void TransferPower(EntityUid uid, EntityUid targetEntity, ChargerComponent component, float frameTime)
{
if (!TryComp(uid, out ApcPowerReceiverComponent? receiverComponent))
Expand Down
25 changes: 9 additions & 16 deletions Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using Content.Server.Parallax;
using Content.Shared.Maps;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Procedural;
using Content.Shared.Procedural.PostGeneration;
Expand All @@ -16,43 +15,35 @@ public sealed partial class DungeonJob
/// </summary>
private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon, HashSet<Vector2i> reservedTiles, Random random)
{
if (!_prototype.TryIndex(dunGen.BiomeTemplate, out var indexedBiome))
if (_entManager.TryGetComponent(_gridUid, out BiomeComponent? biomeComp))
return;

biomeComp = _entManager.AddComponent<BiomeComponent>(_gridUid);
var biomeSystem = _entManager.System<BiomeSystem>();

biomeSystem.SetTemplate(_gridUid, biomeComp, _prototype.Index(dunGen.BiomeTemplate));
var seed = random.Next();
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();

var tiles = _maps.GetAllTilesEnumerator(_gridUid, _grid);
while (tiles.MoveNext(out var tileRef))
foreach (var node in dungeon.RoomTiles)
{
var node = tileRef.Value.GridIndices;

if (reservedTiles.Contains(node))
continue;

if (dunGen.TileMask is not null)
{
if (!dunGen.TileMask.Contains(((ContentTileDefinition) _tileDefManager[tileRef.Value.Tile.TypeId]).ID))
continue;
}

// Need to set per-tile to override data.
if (biomeSystem.TryGetTile(node, indexedBiome.Layers, seed, _grid, out var tile))
if (biomeSystem.TryGetTile(node, biomeComp.Layers, seed, _grid, out var tile))
{
_maps.SetTile(_gridUid, _grid, node, tile.Value);
}

if (biomeSystem.TryGetDecals(node, indexedBiome.Layers, seed, _grid, out var decals))
if (biomeSystem.TryGetDecals(node, biomeComp.Layers, seed, _grid, out var decals))
{
foreach (var decal in decals)
{
_decals.TryAddDecal(decal.ID, new EntityCoordinates(_gridUid, decal.Position), out _);
}
}

if (tile is not null && biomeSystem.TryGetEntity(node, indexedBiome.Layers, tile.Value, seed, _grid, out var entityProto))
if (biomeSystem.TryGetEntity(node, biomeComp, _grid, out var entityProto))
{
var ent = _entManager.SpawnEntity(entityProto, new EntityCoordinates(_gridUid, node + _grid.TileSizeHalfVector));
var xform = xformQuery.Get(ent);
Expand All @@ -70,5 +61,7 @@ private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon
if (!ValidateResume())
return;
}

biomeComp.Enabled = false;
}
}
2 changes: 1 addition & 1 deletion Content.Shared/Parallax/Biomes/SharedBiomeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public bool TryGetEntity(Vector2i indices, BiomeComponent component, MapGridComp
}


public bool TryGetEntity(Vector2i indices, List<IBiomeLayer> layers, Tile tileRef, int seed, MapGridComponent grid,
private bool TryGetEntity(Vector2i indices, List<IBiomeLayer> layers, Tile tileRef, int seed, MapGridComponent grid,
[NotNullWhen(true)] out string? entity)
{
var tileId = TileDefManager[tileRef.TypeId].ID;
Expand Down
7 changes: 0 additions & 7 deletions Content.Shared/Procedural/PostGeneration/BiomeDunGen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Content.Shared.Maps;
using Content.Shared.Parallax.Biomes;
using Robust.Shared.Prototypes;

Expand All @@ -12,10 +11,4 @@ public sealed partial class BiomeDunGen : IDunGenLayer
{
[DataField(required: true)]
public ProtoId<BiomeTemplatePrototype> BiomeTemplate;

/// <summary>
/// creates a biome only on the specified tiles
/// </summary>
[DataField]
public HashSet<ProtoId<ContentTileDefinition>>? TileMask;
}
107 changes: 57 additions & 50 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,4 @@
Entries:
- author: DebugOk
changes:
- message: Atmos hopefully shouldn't break anymore
type: Fix
id: 201
time: '2024-01-07T22:10:36.0000000+00:00'
- author: Bribrooo
changes:
- message: 'added a ChemVend inside of Chemistry on Pebble Station '
type: Add
id: 202
time: '2024-01-11T06:14:27.0000000+00:00'
- author: Adrian
changes:
- message: Shoukou has maintenance now in logistics and in security
type: Tweak
id: 203
time: '2024-01-12T22:08:47.0000000+00:00'
- author: DebugOk
changes:
- message: Added the spare ID safe
type: Add
- message: The captain's locker no longer starts with a spare ID card
type: Remove
id: 204
time: '2024-01-14T23:48:30.0000000+00:00'
- author: Velcroboy
changes:
- message: Added Hammurabi Prison Station. Crime must be punished!
type: Add
id: 205
time: '2024-01-17T03:53:36.0000000+00:00'
- author: Gregg
changes:
- message: Adjusted the rules in regards to PDA confiscation and borg memory.
type: Tweak
id: 206
time: '2024-01-19T10:30:34.0000000+00:00'
- author: DebugOk
changes:
- message: Zombies can no longer be psionic
type: Remove
id: 207
time: '2024-01-19T20:53:05.0000000+00:00'
- author: Adrian16199
changes:
- message: Fixes mantis and them not be able to spawn with duffelbags and satchels.
type: Fix
id: 208
time: '2024-01-19T20:54:29.0000000+00:00'
- author: Adrian16199
changes:
- message: Laika no longer takes 200 damage before dying from critical.
Expand Down Expand Up @@ -3761,3 +3711,60 @@
id: 700
time: '2024-11-24T04:37:29.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2205
- author: deltanedas
changes:
- message: Fixed borgs not having names.
type: Fix
id: 701
time: '2024-11-24T10:06:56.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2276
- author: dotCatshark
changes:
- message: Resprited EE sprites for corpse dragging.
type: Tweak
id: 702
time: '2024-11-24T10:07:37.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2255
- author: Yule&
changes:
- message: NukeOps are 3% less valid.
type: Tweak
id: 703
time: '2024-11-24T10:08:19.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2208
- author: deltanedas
changes:
- message: Re-enabled the portable recharger Tier 3 Arsenal tech.
type: Add
id: 704
time: '2024-11-24T10:09:31.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2206
- author: moth
changes:
- message: Made moth's heat damage less insane.
type: Tweak
id: 705
time: '2024-11-24T10:15:12.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2277
- author: Big Orthagonal
changes:
- message: Diagonal secborgs are not real and were never real.
type: Fix
id: 706
time: '2024-11-24T11:57:37.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2278
- author: deltanedas
changes:
- message: Fixed salvage debris not having anything.
type: Fix
id: 707
time: '2024-11-24T20:25:25.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2280
- author: DisposableCrewmember42
changes:
- message: Hungry? Stuff your face with cream from an emergency pie delivery for
a change!
type: Add
id: 708
time: '2024-11-25T05:30:25.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2211
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comms-console-announcement-title-unauthorized = Unauthorized
2 changes: 1 addition & 1 deletion Resources/Prototypes/Damage/modifier_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
id: Moth # Slightly worse at everything but cold
coefficients:
Cold: 0.7
Heat: 1.3
Heat: 1.1 # DeltaV: was 1.3, too extreme

- type: damageModifierSet
id: Vox
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Cargo/cargo_food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@
cost: 6000 # Thanks bounties
category: Food
group: market

- type: cargoProduct
id: FoodEmergencyPie
icon:
sprite: Objects/Consumable/Food/Baked/pie.rsi
state: tin
product: CrateFoodEmergencyPie
cost: 3333
category: Food
group: market
11 changes: 11 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Fills/Crates/food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@
amount: 1
- id: FoodBoxDonkpocketDink
prob: 0.1

- type: entity
id: CrateFoodEmergencyPie
parent: CratePlastic
name: emergency pie delivery
description: '"Then let them eat pie."'
components:
- type: StorageFill
contents:
- id: FoodPieBananaCream
amount: 13
2 changes: 2 additions & 0 deletions Resources/Prototypes/DeltaV/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMedium
- type: RandomMetadata
nameSegments: [names_borg]

- type: entity
parent: BorgChassisSecurity
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/DeltaV/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# Visual
clientComponents:
- type: Sprite
noRot: true
drawdepth: Mobs
sprite: DeltaV/Mobs/Silicon/chassis.rsi
layers:
- state: security
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMedium
- type: RandomMetadata # DeltaV: give job borgs names
nameSegments: [names_borg]

- type: entity
id: PlayerBorgSyndicateAssaultBattery
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
Cold : 0.05 #per second, scales with temperature & other constants
heatDamage:
types:
Heat : 3 #per second, scales with temperature & other constants
Heat : 1.5 #per second, scales with temperature & other constants # DeltaV: changed to normal heat damage
- type: TemperatureSpeed
thresholds:
289: 0.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
type: WarDeclaratorBoundUserInterface
- type: WarDeclarator
message: war-declarator-default-message
sound: /Audio/Announcements/Alerts/code_red.ogg # DeltaV
- type: AccessReader
access: [["NuclearOperative"]]
Loading

0 comments on commit ba8a505

Please sign in to comment.