Skip to content

Commit

Permalink
Merge branch 'Fansana:master' into skibidi-dragon-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cynical24 authored Aug 29, 2024
2 parents 71be789 + 4014d80 commit 0192ae0
Show file tree
Hide file tree
Showing 205 changed files with 21,367 additions and 19,521 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

Expand All @@ -10,13 +12,62 @@ public partial class ConsentSystem : Migration
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "consent_settings",
columns: table => new
{
consent_settings_id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
user_id = table.Column<Guid>(nullable: false),
consent_freetext = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_consent_settings", x => x.consent_settings_id);
});

migrationBuilder.CreateTable(
name: "consent_toggle",
columns: table => new
{
consent_toggle_id = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
consent_settings_id = table.Column<int>(nullable: false),
toggle_proto_id = table.Column<string>(nullable: false),
toggle_proto_state = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_consent_toggle", x => x.consent_toggle_id);
table.ForeignKey(
name: "FK_consent_toggle_consent_settings_consent_settings_id",
column: x => x.consent_settings_id,
principalTable: "consent_settings",
principalColumn: "consent_settings_id",
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateIndex(
name: "IX_consent_settings_user_id",
table: "consent_settings",
column: "user_id",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_consent_toggle_consent_settings_id_toggle_proto_id",
table: "consent_toggle",
columns: new[] { "consent_settings_id", "toggle_proto_id" },
unique: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "consent_toggle");

migrationBuilder.DropTable(
name: "consent_settings");
}
}
}
81 changes: 55 additions & 26 deletions Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Atmos.Components;
using Content.Shared.Administration;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
Expand Down Expand Up @@ -84,44 +85,72 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
continue;
}

var transform = Transform(euid.Value);
// Force Invalidate & update air on all tiles
Entity<GridAtmosphereComponent, GasTileOverlayComponent, MapGridComponent, TransformComponent> grid =
new(euid.Value, gridAtmosphere, Comp<GasTileOverlayComponent>(euid.Value), gridComp, Transform(euid.Value));

foreach (var (indices, tileMain) in gridAtmosphere.Tiles)
{
var tile = tileMain.Air;
if (tile == null)
continue;
RebuildGridTiles(grid);

if (!_mapSystem.TryGetTile(gridComp, indices, out var gTile) || gTile.IsEmpty)
{
gridAtmosphere.Tiles.Remove(indices);
var query = GetEntityQuery<AtmosFixMarkerComponent>();
foreach (var (indices, tile) in gridAtmosphere.Tiles.ToArray())
{
if (tile.Air is not {Immutable: false} air)
continue;
}

if (tile.Immutable && !IsTileSpace(euid, transform.MapUid, indices))
{
tile = new GasMixture(tile.Volume) { Temperature = tile.Temperature };
tileMain.Air = tile;
}

tile.Clear();
air.Clear();
var mixtureId = 0;
foreach (var entUid in gridComp.GetAnchoredEntities(indices))
var enumerator = _mapSystem.GetAnchoredEntitiesEnumerator(grid, grid, indices);
while (enumerator.MoveNext(out var entUid))
{
if (!TryComp(entUid, out AtmosFixMarkerComponent? afm))
continue;
mixtureId = afm.Mode;
break;
if (query.TryComp(entUid, out var marker))
mixtureId = marker.Mode;
}
var mixture = mixtures[mixtureId];
Merge(tile, mixture);
tile.Temperature = mixture.Temperature;

gridAtmosphere.InvalidatedCoords.Add(indices);
var mixture = mixtures[mixtureId];
Merge(air, mixture);
air.Temperature = mixture.Temperature;
}
}
}

/// <summary>
/// Clears & re-creates all references to <see cref="TileAtmosphere"/>s stored on a grid.
/// </summary>
private void RebuildGridTiles(
Entity<GridAtmosphereComponent, GasTileOverlayComponent, MapGridComponent, TransformComponent> ent)
{
foreach (var indices in ent.Comp1.Tiles.Keys)
{
InvalidateVisuals((ent, ent), indices);
}

var atmos = ent.Comp1;
atmos.MapTiles.Clear();
atmos.ActiveTiles.Clear();
atmos.ExcitedGroups.Clear();
atmos.HotspotTiles.Clear();
atmos.SuperconductivityTiles.Clear();
atmos.HighPressureDelta.Clear();
atmos.CurrentRunTiles.Clear();
atmos.CurrentRunExcitedGroups.Clear();
atmos.InvalidatedCoords.Clear();
atmos.CurrentRunInvalidatedTiles.Clear();
atmos.PossiblyDisconnectedTiles.Clear();
atmos.Tiles.Clear();

var volume = GetVolumeForTiles(ent);
TryComp(ent.Comp4.MapUid, out MapAtmosphereComponent? mapAtmos);

var enumerator = _map.GetAllTilesEnumerator(ent, ent);
while (enumerator.MoveNext(out var tileRef))
{
var tile = GetOrNewTile(ent, ent, tileRef.Value.GridIndices);
UpdateTileData(ent, mapAtmos, tile);
UpdateAdjacentTiles(ent, tile, activate: true);
UpdateTileAir(ent, tile, volume);
}
}

private CompletionResult FixGridAtmosCommandCompletions(IConsoleShell shell, string[] args)
{
MapId? playerMap = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public sealed partial class AtmosphereSystem
private int _currentRunAtmosphereIndex;
private bool _simulationPaused;

private TileAtmosphere GetOrNewTile(EntityUid owner, GridAtmosphereComponent atmosphere, Vector2i index)
private TileAtmosphere GetOrNewTile(EntityUid owner, GridAtmosphereComponent atmosphere, Vector2i index, bool invalidateNew = true)
{
var tile = atmosphere.Tiles.GetOrNew(index, out var existing);
if (existing)
return tile;

atmosphere.InvalidatedCoords.Add(index);
if (invalidateNew)
atmosphere.InvalidatedCoords.Add(index);

tile.GridIndex = owner;
tile.GridIndices = index;
return tile;
Expand Down Expand Up @@ -68,7 +70,7 @@ private bool ProcessRevalidate(Entity<GridAtmosphereComponent, GasTileOverlayCom
atmosphere.CurrentRunInvalidatedTiles.EnsureCapacity(atmosphere.InvalidatedCoords.Count);
foreach (var indices in atmosphere.InvalidatedCoords)
{
var tile = GetOrNewTile(uid, atmosphere, indices);
var tile = GetOrNewTile(uid, atmosphere, indices, invalidateNew: false);
atmosphere.CurrentRunInvalidatedTiles.Enqueue(tile);

// Update tile.IsSpace and tile.MapAtmosphere, and tile.AirtightData.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Shared.Floofstation.Traits.Components;

[RegisterComponent]
public sealed partial class FixtureDensityModifierComponent : Component
{
/// <summary>
/// The minimum and maximum density that may be used as input for and achieved as a result of application of this component.
/// </summary>
[DataField]
public float Min = float.Epsilon, Max = float.PositiveInfinity;

[DataField]
public float Factor = 1f;
}
35 changes: 35 additions & 0 deletions Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Content.Shared.Contests;
using Content.Shared.Floofstation.Traits.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Systems;

namespace Content.Shared.Floofstation.Traits;

public sealed partial class TraitStatModifierSystem : EntitySystem
{
[Dependency] private readonly ContestsSystem _contests = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;

public override void Initialize()
{
SubscribeLocalEvent<FixtureDensityModifierComponent, MapInitEvent>(OnInitDensity); // Traits are added after CharacterSpawnedEvent so it's fine™
}

private void OnInitDensity(Entity<FixtureDensityModifierComponent> ent, ref MapInitEvent args)
{
if (!TryComp<FixturesComponent>(ent.Owner, out var fixtures))
return;

foreach (var (id, fix) in fixtures.Fixtures)
{
if (!fix.Hard || fix.Density < ent.Comp.Min || fix.Density > ent.Comp.Max)
continue;

var result = Math.Clamp(fix.Density * ent.Comp.Factor, ent.Comp.Min, ent.Comp.Max);
_physics.SetDensity(ent, id, fix, result, update: false, fixtures);
}

_fixtures.FixtureUpdate(ent, true, true, fixtures);
}
}
Binary file added Resources/Audio/Floof/Lewd/vibrate.ogg
Binary file not shown.
51 changes: 51 additions & 0 deletions Resources/Changelog/Floof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -684,3 +684,54 @@ Entries:
message: Zombies are gone from this sector, for now...
id: 93
time: '2024-08-24T18:47:06.0000000+00:00'
- author: ShatteredSwords
changes:
- type: Tweak
message: Thieves have started appearing without Traitors...
id: 94
time: '2024-08-25T05:59:41.0000000+00:00'
- author: ShatteredSwords
changes:
- type: Fix
message: IPCs can no longer be vampiric.
id: 95
time: '2024-08-25T17:13:10.0000000+00:00'
- author: Fansana
changes:
- type: Fix
message: >-
Fixed most door accesses including: Lawyer, Mantis, Corpsman, Boxer,
Clown, Mime, Musician, Reporter, Library, Zookeeper, Salvage and
Psychologist.
id: 96
time: '2024-08-25T17:57:54.0000000+00:00'
- author: cynical24
changes:
- type: Tweak
message: carpets now have proper naming schemes! :3
- type: Fix
message: >-
when crafting curtains/fancy tables, your entire stack of hard-earned
carpet will no longer be used all at once! :3
id: 97
time: '2024-08-26T13:20:19.0000000+00:00'
- author: Memeji
changes:
- type: Add
message: added Dildos
- type: Add
message: added Fleshlights
- type: Add
message: added Vibrators
id: 98
time: '2024-08-27T02:25:12.0000000+00:00'
- author: fenndragon
changes: []
id: 99
time: '2024-08-27T20:07:59.0000000+00:00'
- author: Mnemotechnician
changes:
- type: Add
message: Added two new physical traits - weakness and lightweight
id: 100
time: '2024-08-29T14:51:40.0000000+00:00'
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/Floof/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ trait-description-MilkProducer = You have a pair of large mammaries.
trait-name-SquirtProducer = Pussy
trait-description-SquirtProducer = You have a slit between your legs.
trait-name-Weakness = Weakness
trait-description-Weakness = You are naturally more vulnerable to fatigue. Your stamina pool is halved, making you greately vulnerable to shoving and stunning attacks.
trait-name-Lightweight = Lightweight
trait-description-Lightweight =
You are naturally lighter than other representatives of your species. Your body density is reduced to 2/3 of normal.
Note: [color=red]this will not display in the character creation menu, and will only have effect in-game.[/color]
Loading

0 comments on commit 0192ae0

Please sign in to comment.