Allergies exist, Please don't make me regret this. (I already do)#284
Allergies exist, Please don't make me regret this. (I already do)#284ScarlettJFG wants to merge 6 commits intoFloof-Station:masterfrom
Conversation
|
I can mark this as "In-progress" if it needs changes, since this is a rather large port, I did not get a full understanding of everything, but it works as is, just a little...chaotic for medical when someone doesn't list their allergies...or are allergic to meds. |
im not a maintainer, but i know changelogs need to actually list.. yknow, the changes. just letting you know maybe something like |
Mnemotechnician
left a comment
There was a problem hiding this comment.
Structurally this PR looks fine, but database migrations need to be re-created based on our current db model to avoid potentially corrupting the live db
| using Microsoft.EntityFrameworkCore.Migrations; | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Content.Server.Database.Migrations.Postgres | ||
| { | ||
| /// <inheritdoc /> | ||
| public partial class CDAllergies : Migration | ||
| { | ||
| /// <inheritdoc /> | ||
| protected override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.CreateTable( | ||
| name: "cd_character_allergies", | ||
| columns: table => new | ||
| { | ||
| allergen = table.Column<string>(type: "TEXT", nullable: false), | ||
| cdprofile_id = table.Column<int>(type: "INTEGER", nullable: false), | ||
| intensity = table.Column<int>(type: "INTEGER", nullable: false) | ||
| }, | ||
| constraints: table => | ||
| { | ||
| table.PrimaryKey("PK_cd_character_allergies", x => new { x.cdprofile_id, x.allergen }); | ||
| table.ForeignKey( | ||
| name: "FK_cd_character_allergies_cdprofile_cdprofile_id", | ||
| column: x => x.cdprofile_id, | ||
| principalTable: "cdprofile", | ||
| principalColumn: "cdprofile_id", | ||
| onDelete: ReferentialAction.Cascade); | ||
| }); | ||
|
|
||
| migrationBuilder.CreateIndex( | ||
| name: "IX_cd_character_allergies_cdprofile_id_allergen", | ||
| table: "cd_character_allergies", | ||
| columns: new[] { "cdprofile_id", "allergen" }); | ||
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.DropTable( | ||
| name: "cd_character_allergies"); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
All these database migration files should be deleted and re-created by running the add_migration.sh script in Content.Server.Database since they don't match our db model
There was a problem hiding this comment.
I think I did it right? not 100% certain, but I did run the script after deleting those.
There was a problem hiding this comment.
You didn't delete the old ones, e.g. this one (20250609134446_CDAllergies.cs) is still here.
There was a problem hiding this comment.
Third time is the charm? I hope?
Automated Change from PR Co-authored-by: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com> Signed-off-by: ScarlettJFG <scottvanhorngaming@gmail.com>
|
When the repo was updated, there was a database conflict. Recommendation that the changes are implemented into a fresh branch to see if the issue is still present. This PR is DNM for now. |
|
Hmmm we checked in the original GitHub for CD, and we're wondering if this is relevant: cosmatic-drift-14/cosmatic-drift#727 We don't know anything worthwhile about code or databases, but this might have been from the same issue? |
About the PR
Adds Allergies and the associated effects to the game.
Why / Balance
EVERYONE WANTS MEDICAL TO [SUFFER](https://discord.com/channels/1255902263667331193/1478151943078674484/1482892877188173925)
Technical details
I'll be completely honest: It's a near 1:1 port from this PR, but with a minor change (I...didn't need to add lines for the allergies to grab what was processed). This adds changes to the server.database folder for records, HumanoidCharacterProfile for attaching the allergies, Histamine in the toxins.yml, and frankly, this is just a port. All of the edits however, allows the selections from the profile editor in lobby to be used, but does not sync the "Allergies" text field, with what is selected. Medical should be able to pick up on an allergen fairly quickly however, so this doesn't...completely screw them over.
Media
Click to show
Discord link to Video (Will open in browser, a little too big to upload here)
Requirements
Licensing:
Breaking changes
Allergies selected do not update in the Allergies text field in records.
Transforming (Geras or fox form) will temporarily pause allergic reactions, at least until transformed back. This can be used as a way to treat certain issues you might otherwise be allergic to, without death...unless it's too late.
Sources
As listed above, This PR is where the port is from.
Changelog
🆑