Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg committed Sep 8, 2024
2 parents 825dadf + 0008033 commit 7d4b56a
Show file tree
Hide file tree
Showing 588 changed files with 2,345 additions and 1,194 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ on:
types: [closed]

env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANGELOG_DIR: Resources/Changelog/ChangelogLPP.yml
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANGELOG_DIR: ${{ vars.CHANGELOG_DIR }}
PR_NUMBER: ${{ github.event.number }}
CHANGELOG_DISCORD_WEBHOOK: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}

jobs:
changelog:
Expand All @@ -21,7 +20,7 @@ jobs:
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_TOKEN }}
ref: master
ref: ${{ vars.CHANGELOG_BRANCH }}

- name: Setup Git
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/close-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
steps:
- uses: superbrothers/close-pull-request@v3
with:
github_token: ${{ secrets.BOT_TOKEN }}
comment: "Благодарим вас за вклад в наш репозиторий. К сожалению, похоже, что вы отправили ПР из master ветки. Мы рекомендуем вам следовать [документации](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html). \n\n Вы можете перенести свою текущую работу из основной ветки в другую ветку с помощью [создания новой](https://git-scm.com/docs/git-branch) и [очистки](https://git-scm.com/docs/git-reset) master ветки."

# If you prefer to just comment on the pr and not close it, uncomment the bellow and comment the above
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conflict-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
uses: ike709/actions-label-merge-conflict@9eefdd17e10566023c46d2dc6dc04fcb8ec76142
with:
dirtyLabel: "Статус: Конфликт"
repoToken: "${{ secrets.BOT_TOKEN }}"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "В этом ПР'е есть конфликты, пожалуйста, устраните их, прежде чем мы сможем оценить ваш ПР."
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Changelog
name: Discord Changelog

on:
workflow_dispatch:
Expand All @@ -13,12 +13,12 @@ jobs:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{secrets.BOT_TOKEN}}
ref: master

- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANGELOG_DISCORD_WEBHOOK: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}
CHANGELOG_DIR: ${{ vars.CHANGELOG_DIR }}
CHANGELOG_WEBHOOK: ${{ secrets.CHANGELOG_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
continue-on-error: true
2 changes: 0 additions & 2 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Статус: Требуется одобрение"
repo-token: "${{ secrets.BOT_TOKEN }}"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "Статус: Ожидание изменений"
repo-token: "${{ secrets.BOT_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/labeler-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.BOT_TOKEN }}"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 0 additions & 3 deletions .github/workflows/rsi-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
token: ${{ secrets.BOT_TOKEN }}
body: |
${{ steps.diff.outputs.summary-details }}
Expand All @@ -53,7 +52,6 @@ jobs:
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ secrets.BOT_TOKEN }}
edit-mode: replace
body: |
${{ steps.diff.outputs.summary-details }}
Expand All @@ -63,7 +61,6 @@ jobs:
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ secrets.BOT_TOKEN }}
edit-mode: append
body: |
Edit: diff updated after ${{ github.event.pull_request.head.sha }}
5 changes: 1 addition & 4 deletions .github/workflows/test-secrets1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ name: YAML Linter Secrets
on:
push:
branches: [ master, staging, trying ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]

jobs:
build:
name: YAML Linter Secrets
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' && github.actor != 'Lost-Paradise-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' && github.actor != 'Lost-Paradise-Bot' && github.repository == 'Lost-Paradise-Project/Lost-Paradise'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/test-secrets2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,11 @@ on:
# why not just do both
- 'RobustToolbox'
- 'RobustToolbox/**'
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
branches: [ master ]
paths:
- '**.cs'
- '**.csproj'
- '**.sln'
- '**.git**'
- '**.yml'
- 'RobustToolbox'
- 'RobustToolbox/**'

jobs:
build:
name: Test Packaging Secrets
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'Lost-Paradise-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'Lost-Paradise-Bot' && github.repository == 'Lost-Paradise-Project/Lost-Paradise'
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-secrets3.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Build & Test Debug Secrets


on:
push:
branches: [ master, staging, trying ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
branches: [ master ]

jobs:
build:
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' && github.actor != 'Lost-Paradise-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' && github.actor != 'Lost-Paradise-Bot' && github.repository == 'Lost-Paradise-Project/Lost-Paradise'
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
45 changes: 45 additions & 0 deletions Content.Server/HeightAdjust/BloodstreamAdjustSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Content.Server.Body.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.CCVar;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Contests;
using Content.Shared.HeightAdjust;
using Robust.Shared.Configuration;

namespace Content.Server.HeightAdjust;

public sealed class BloodstreamAdjustSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly ContestsSystem _contests = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;

public override void Initialize()
{
SubscribeLocalEvent<BloodstreamAffectedByMassComponent, MapInitEvent>((uid, comp, _) => TryAdjustBloodstream((uid, comp)));
SubscribeLocalEvent<BloodstreamAffectedByMassComponent, HeightAdjustedEvent>((uid, comp, _) => TryAdjustBloodstream((uid, comp)));
}

/// <summary>
/// Adjusts the bloodstream of the specified entity based on the settings provided by the component.
/// </summary>
public bool TryAdjustBloodstream(Entity<BloodstreamAffectedByMassComponent> ent)
{
if (!TryComp<BloodstreamComponent>(ent, out var bloodstream)
|| !_solutionContainer.TryGetSolution(ent.Owner, bloodstream.BloodSolutionName, out var bloodSolutionEnt)
|| !_config.GetCVar(CCVars.HeightAdjustModifiesBloodstream))
return false;

var bloodSolution = bloodSolutionEnt.Value.Comp.Solution;

var factor = Math.Pow(_contests.MassContest(ent, bypassClamp: true, rangeFactor: 4f), ent.Comp.Power);
factor = Math.Clamp(factor, ent.Comp.Min, ent.Comp.Max);

var newVolume = bloodstream.BloodMaxVolume * factor;
var newBloodLevel = bloodSolution.FillFraction * newVolume;
bloodSolution.MaxVolume = newVolume;
bloodSolution.SetContents([new ReagentQuantity(bloodstream.BloodReagent, newBloodLevel, null)], false);

return true;
}
}
26 changes: 26 additions & 0 deletions Content.Server/HeightAdjust/BloodstreamAffectedByMassComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Content.Server.Body.Components;

namespace Content.Server.HeightAdjust;

/// <summary>
/// When applied to a humanoid or any mob, adjusts their blood level based on the mass contest between them
/// and an average humanoid.
/// <br/>
/// The formula for the resulting bloodstream volume is <code>V = BloodMaxVolume * MassContest^Power</code>
/// clamped between the specified Min and Max values.
/// </summary>
[RegisterComponent]
public sealed partial class BloodstreamAffectedByMassComponent : Component
{
/// <summary>
/// Minimum and maximum resulting volume factors. A minimum value of 0.5 means that the resulting volume will be at least 50% of the original.
/// </summary>
[DataField]
public float Min = 1 / 3f, Max = 3f;

/// <summary>
/// The power to which the outcome of the mass contest will be risen.
/// </summary>
[DataField]
public float Power = 1f;
}
42 changes: 42 additions & 0 deletions Content.Server/InteractionVerbs/Actions/MoodAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Content.Shared.InteractionVerbs;
using Content.Shared.Mood;
using Robust.Shared.Prototypes;

namespace Content.Server.InteractionVerbs.Actions;

/// <summary>
/// An action that adds a moodlet to the target, or removes one.
/// </summary>
[Serializable]
public sealed partial class MoodAction : InteractionAction
{
[DataField(required: true)]
public ProtoId<MoodEffectPrototype> Effect;

/// <summary>
/// Parameters for the <see cref="MoodEffectEvent"/>. Only used if <see cref="Remove"/> is false.
/// </summary>
[DataField]
public float Modifier = 1f, Offset = 0f;

/// <summary>
/// If true, the moodlet will be removed. Otherwise, it will be added.
/// </summary>
[DataField]
public bool Remove = false;

public override bool CanPerform(InteractionArgs args, InteractionVerbPrototype proto, bool isBefore, VerbDependencies deps)
{
return true;
}

public override bool Perform(InteractionArgs args, InteractionVerbPrototype proto, VerbDependencies deps)
{
if (Remove)
deps.EntMan.EventBus.RaiseLocalEvent(args.Target, new MoodRemoveEffectEvent(Effect));
else
deps.EntMan.EventBus.RaiseLocalEvent(args.Target, new MoodEffectEvent(Effect, Modifier, Offset));

return true; // Mood system is shitcode so we can't even know if the effect was added or anything
}
}
Loading

0 comments on commit 7d4b56a

Please sign in to comment.