-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
588 changed files
with
2,345 additions
and
1,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
Content.Server/HeightAdjust/BloodstreamAffectedByMassComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.