Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream Merge 6 22 2024 #26

Merged
merged 98 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0673211
Two new CVars and height slider now shows actual height in CM
VMSolidus Jun 19, 2024
fabcdfa
Merge branch 'master' into port-of-height-sliders
VMSolidus Jun 19, 2024
639a17e
Height sliders now include weight
VMSolidus Jun 19, 2024
2545218
UI now automatically resizes the preview
VMSolidus Jun 19, 2024
69ec1a8
More Exciting Shell Casings
VMSolidus Jun 19, 2024
eb9d2da
Mass Contests Remake
VMSolidus Jun 20, 2024
1701ded
Update SharedCuffableSystem.cs
VMSolidus Jun 20, 2024
f149d46
Harpy Peacock Tail (#428)
VMSolidus Jun 20, 2024
896627d
Automatic Changelog Update (#428)
SimpleStation14 Jun 20, 2024
5bc2f59
Merge branch 'master' into The-Great-Massening-Guns
DangerRevolution Jun 20, 2024
b353d95
Port Randomly Fire Dropped Weapons (#471)
VMSolidus Jun 20, 2024
ff6e9b7
Automatic Changelog Update (#471)
SimpleStation14 Jun 20, 2024
1a1263f
Update HandcuffComponent.cs
VMSolidus Jun 20, 2024
bc0e2e6
Port Random Bark System (#466)
VMSolidus Jun 20, 2024
d42cd67
Automatic Changelog Update (#466)
SimpleStation14 Jun 20, 2024
4b8036c
Mirror 26250: Make all implants unable to be implanted more than once…
SimpleStation14 Jun 20, 2024
2961bf4
Mirror: Bumps LoneOps minimum required players to 20 (#263)
SimpleStation14 Jun 20, 2024
cc4f19f
Merge branch 'master' into The-Great-Massening-Guns
DangerRevolution Jun 20, 2024
282b207
Apply suggestions from code review
VMSolidus Jun 20, 2024
d3ed34f
Trait Points (#434)
DEATHB4DEFEAT Jun 20, 2024
287f33c
Automatic Changelog Update (#434)
SimpleStation14 Jun 20, 2024
4b4dbea
Merge branch 'master' into port-of-height-sliders
VMSolidus Jun 20, 2024
ff8f568
Merge branch 'master' into MassContests-Remake
VMSolidus Jun 21, 2024
c3b54db
guh
VMSolidus May 3, 2024
839eac1
Psionic Refactor pt 1
VMSolidus May 3, 2024
ac83004
Last bit
VMSolidus May 3, 2024
4ad73d4
I accidentally sent the DeltaV legacy version of these
VMSolidus May 3, 2024
8c0fc8d
Finishing Mind Swap rework
VMSolidus May 14, 2024
fa213b7
Noospheric Zap updating
VMSolidus May 14, 2024
2ef711c
Almost done
VMSolidus May 15, 2024
4e919ee
guh
VMSolidus May 15, 2024
ca07c5c
More migrations
VMSolidus May 15, 2024
2cbcfb9
Final migrations
VMSolidus May 15, 2024
6bb7093
Last set of migrations
VMSolidus May 15, 2024
51d4c1b
Update PsionicsSystem.cs
VMSolidus May 15, 2024
90ebdb5
Almost got it, one last bug to squash
VMSolidus May 15, 2024
52ea837
slightly more acccurate but still not quite right
VMSolidus May 15, 2024
4f8a6b8
Update PyrokinesisPowerSystem.cs
VMSolidus May 15, 2024
577e51a
removing some errant instances of potentialpsionic
VMSolidus May 15, 2024
a6f8d40
Revert "removing some errant instances of potentialpsionic"
VMSolidus May 15, 2024
f677d5a
Final power update
VMSolidus May 15, 2024
5ac883e
Update psionicPowers.yml
VMSolidus May 15, 2024
e9f1ae0
Update psionic.ftl
VMSolidus May 15, 2024
f951e22
some more small tweaks
VMSolidus May 15, 2024
2fc2351
Update PotentialPsionicComponent.cs
VMSolidus May 15, 2024
2e706d1
Update PsionicAbilitiesSystem.cs
VMSolidus May 15, 2024
96174af
Update Content.Server/Psionics/Abilities/PsionicAbilitiesSystem.cs
VMSolidus May 15, 2024
60f76ea
remove downstream comments
VMSolidus May 15, 2024
a5c6210
Giving pyrokinesis back to ifrit, and setting up base caster stat bon…
VMSolidus May 15, 2024
c703766
Update familiars.yml
VMSolidus May 15, 2024
e4163c6
Update PsionicRegenerationPowerSystem.cs
VMSolidus May 29, 2024
6539713
Revert "Merge branch 'master' of https://github.com/VMSolidus/Einstei…
VMSolidus May 29, 2024
f59b62e
Revert "what"
VMSolidus Jun 13, 2024
409f5fa
Mirror: Trading Outpost now has half buy-only and half sell-only pall…
SimpleStation14 Jun 16, 2024
7240412
Update Credits (#437)
github-actions[bot] Jun 16, 2024
32328cb
Corpo Jacket Fixes (#462)
Pspritechologist Jun 16, 2024
3bae97d
Default to Separated UI Layout (#433)
DEATHB4DEFEAT Jun 16, 2024
34e5669
Build doc cleanup (#470)
stellar-novas Jun 16, 2024
5b69766
Move Changelog Bot to Changelogs Directory (#469)
DEATHB4DEFEAT Jun 17, 2024
d34f64b
Port Frictionless Space (#464)
VMSolidus Jun 17, 2024
cef74f3
Mirror: Landmine stepoff (#358)
SimpleStation14 Jun 17, 2024
c03835e
Workflow to Automatically Title Case PRs (#468)
DEATHB4DEFEAT Jun 17, 2024
17cf334
Revert "Merge branch 'master' of https://github.com/VMSolidus/Einstei…
VMSolidus Jun 17, 2024
df88298
Reapply "Merge branch 'master' of https://github.com/VMSolidus/Einste…
VMSolidus Jun 17, 2024
8d72195
Fix PRTitleCase Workflow (#472)
DEATHB4DEFEAT Jun 17, 2024
bc93199
Port Station Goals (#465)
VMSolidus Jun 17, 2024
70badaa
Automatic Changelog Update (#465)
SimpleStation14 Jun 17, 2024
d1cae9a
Harpy Peacock Tail (#428)
VMSolidus Jun 20, 2024
90bca5a
Automatic Changelog Update (#428)
SimpleStation14 Jun 20, 2024
af3a963
Port Randomly Fire Dropped Weapons (#471)
VMSolidus Jun 20, 2024
97f1960
Automatic Changelog Update (#471)
SimpleStation14 Jun 20, 2024
2177160
Port Random Bark System (#466)
VMSolidus Jun 20, 2024
a17fb08
Automatic Changelog Update (#466)
SimpleStation14 Jun 20, 2024
80217d6
Mirror 26250: Make all implants unable to be implanted more than once…
SimpleStation14 Jun 20, 2024
87084f8
Mirror: Bumps LoneOps minimum required players to 20 (#263)
SimpleStation14 Jun 20, 2024
ff9fe08
Trait Points (#434)
DEATHB4DEFEAT Jun 20, 2024
d0bf466
Automatic Changelog Update (#434)
SimpleStation14 Jun 20, 2024
02427b4
Revert "Merge remote-tracking branch 'upstream/master' into Additiona…
VMSolidus Jun 21, 2024
e6e1e46
Revert "Merge branch 'master' into Additional-Loadout-Items"
VMSolidus Jun 21, 2024
4c2129f
Merge remote-tracking branch 'upstream/master' into Additional-Loadou…
VMSolidus Jun 21, 2024
a76045e
Merging with species listing
VMSolidus Jun 21, 2024
e467fdf
Character instead of Loadout now
VMSolidus Jun 21, 2024
4bd700c
Update categories.yml
VMSolidus Jun 21, 2024
c43866b
Traits plural and species singular
VMSolidus Jun 21, 2024
8d55d8c
Update security.yml
VMSolidus Jun 21, 2024
f4289f9
Mistake in death code that wasn't caught by the tests until an item f…
VMSolidus Jun 21, 2024
02d528e
Merge branch 'master' into Psionic-Power-Refactor
VMSolidus Jun 21, 2024
e6e69c0
Now featuring trait points
VMSolidus Jun 21, 2024
a1d2081
Update loadouts per feedback
VMSolidus Jun 21, 2024
c5301df
Upstream Merge
VMSolidus Jun 22, 2024
fd2e167
Merge remote-tracking branch 'EE-Personal/Additional-Loadout-Items' i…
VMSolidus Jun 22, 2024
375e502
Merge remote-tracking branch 'EE-Personal/Psionic-Power-Refactor' int…
VMSolidus Jun 22, 2024
2026495
Merge remote-tracking branch 'EE-Personal/The-Great-Massening-Guns' i…
VMSolidus Jun 22, 2024
3030ea1
Merge remote-tracking branch 'EE-Personal/MassContests-Remake' into u…
VMSolidus Jun 22, 2024
abc0dad
Merge remote-tracking branch 'EE-Personal/port-of-height-sliders' int…
VMSolidus Jun 22, 2024
586aaa4
Mass Contests
VMSolidus Jun 22, 2024
9f46ddc
Merge branch 'master' into upstream-merge-6-22-2024
VMSolidus Jun 22, 2024
7255f1d
Update trash_drinks.yml
VMSolidus Jun 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ public override void LoadProfile(EntityUid uid, HumanoidCharacterProfile profile
humanoid.Species = profile.Species;
humanoid.SkinColor = profile.Appearance.SkinColor;
humanoid.EyeColor = profile.Appearance.EyeColor;
humanoid.Height = profile.Height; // Parkstation-HeightSlider
humanoid.Width = profile.Width; // Parkstation-HeightSlider
humanoid.Height = profile.Height;
humanoid.Width = profile.Width;

UpdateSprite(humanoid, Comp<SpriteComponent>(uid));
}
Expand Down
27 changes: 21 additions & 6 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<Control HorizontalExpand="True"/>
<OptionButton Name="CSpawnPriorityButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Height -->
<!-- Height -->
<BoxContainer HorizontalExpand="True">
<Label Name="CHeightLabel" MinWidth="110" />
<Slider Name="CHeightSlider" MinValue="0.5" Value="1" MaxValue="1.5" HorizontalExpand="True" Margin="5 0 5 0" />
Expand All @@ -121,6 +121,10 @@
<Slider Name="CWidthSlider" MinValue="0.5" Value="1" MaxValue="1.5" HorizontalExpand="True" Margin="5 0 5 0" />
<Button Name="CWidthReset" Text="{Loc 'ui-options-bind-reset'}" />
</BoxContainer>
<!--Weight -->
<BoxContainer HorizontalExpand="True">
<Label Name="CWeightLabel" />
</BoxContainer>
</BoxContainer>
<!-- Skin -->
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
Expand Down Expand Up @@ -154,18 +158,29 @@
<BoxContainer Name="CAntagList" Orientation="Vertical" />
</ScrollContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Margin="10">
<BoxContainer Name="CTraitsTab" Orientation="Vertical" Margin="10">
<!-- Traits -->
<ScrollContainer VerticalExpand="True">
<BoxContainer Name="CTraitsList" Orientation="Vertical" />
</ScrollContainer>
<Label Name="TraitPointsLabel" HorizontalAlignment="Stretch" Align="Center" />
<ProgressBar Name="TraitPointsBar" MaxValue="1" Value="1" MaxHeight="8" Margin="0 5" />

<Button Name="TraitsShowUnusableButton"
Text="{Loc 'humanoid-profile-editor-traits-show-unusable-button'}"
ToolTip="{Loc 'humanoid-profile-editor-traits-show-unusable-button-tooltip'}"
ToggleMode="True"
Margin="0 0 0 5" />

<TabContainer Name="CTraitsTabs" VerticalExpand="True" />
</BoxContainer>
<BoxContainer Name="CLoadoutsTab" Orientation="Vertical" Margin="10">
<!-- Loadouts -->
<Label Name="LoadoutPointsLabel" HorizontalAlignment="Stretch" Align="Center" />
<ProgressBar Name="LoadoutPointsBar" MaxValue="1" Value="1" MaxHeight="8" Margin="0 5" />

<Button Name="CHideShowUnusableButton" Text="{Loc 'humanoid-profile-editor-loadouts-show-unusable-button'}" ToolTip="{Loc 'humanoid-profile-editor-loadouts-show-unusable-button-tooltip'}" ToggleMode="True" Margin="0 0 0 5" />
<Button Name="LoadoutsShowUnusableButton"
Text="{Loc 'humanoid-profile-editor-loadouts-show-unusable-button'}"
ToolTip="{Loc 'humanoid-profile-editor-loadouts-show-unusable-button-tooltip'}"
ToggleMode="True"
Margin="0 0 0 5" />

<TabContainer Name="CLoadoutsTabs" VerticalExpand="True" />
</BoxContainer>
Expand Down
617 changes: 491 additions & 126 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Content.Client/Traits/ParacusiaSystem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Numerics;
using Content.Shared.Traits.Assorted;
using Content.Shared.Traits.Assorted.Systems;
using Robust.Shared.Random;
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
using Content.Shared.Traits.Assorted.Components;

namespace Content.Client.Traits;

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
using Content.Shared.Inventory;
using Content.Shared.Physics;
using Content.Shared.Tag;
using Content.Shared.Traits.Assorted;
using Content.Shared.Weapons.Melee.Events;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Timing;
using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
using Content.Shared.Traits.Assorted.Components;

namespace Content.Server.Flash
{
Expand Down
21 changes: 21 additions & 0 deletions Content.Server/Implants/ImplanterSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Linq;
using Content.Server.Popups;
using Content.Shared.DoAfter;
using Content.Shared.IdentityManagement;
Expand Down Expand Up @@ -57,6 +58,17 @@ private void OnImplanterAfterInteract(EntityUid uid, ImplanterComponent componen
return;
}

// Check if we are trying to implant a implant which is already implanted
if (implant.HasValue && !component.AllowMultipleImplants && CheckSameImplant(target, implant.Value))
{
var name = Identity.Name(target, EntityManager, args.User);
var msg = Loc.GetString("implanter-component-implant-already", ("implant", implant), ("target", name));
_popup.PopupEntity(msg, target, args.User);
args.Handled = true;
return;
}


//Implant self instantly, otherwise try to inject the target.
if (args.User == target)
Implant(target, target, uid, component);
Expand All @@ -67,6 +79,15 @@ private void OnImplanterAfterInteract(EntityUid uid, ImplanterComponent componen
args.Handled = true;
}

public bool CheckSameImplant(EntityUid target, EntityUid implant)
{
if (!TryComp<ImplantedComponent>(target, out var implanted))
return false;

var implantPrototype = Prototype(implant);
return implanted.ImplantContainer.ContainedEntities.Any(entity => Prototype(entity) == implantPrototype);
}

/// <summary>
/// Attempt to implant someone else.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Content.Server.StationEvents.Components;
using Content.Server.Traits.Assorted;
using Content.Shared.Mind.Components;
using Content.Shared.Traits.Assorted;
using Content.Shared.Traits.Assorted.Components;

namespace Content.Server.StationEvents.Events;

Expand Down
2 changes: 2 additions & 0 deletions Content.Server/Traits/Assorted/ParacusiaSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Content.Shared.Traits.Assorted;
using Content.Shared.Traits.Assorted.Systems;
using Robust.Shared.Audio;
using Content.Shared.Traits.Assorted.Components;

namespace Content.Server.Traits.Assorted;

Expand Down
40 changes: 19 additions & 21 deletions Content.Server/Traits/TraitSystem.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
using System.Linq;
using Content.Server.GameTicking;
using Content.Server.Players.PlayTimeTracking;
using Content.Shared.Customization.Systems;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Roles;
using Content.Shared.Traits;
using Pidgin.Configuration;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager;

namespace Content.Server.Traits;

public sealed class TraitSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ISerializationManager _serializationManager = default!;
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly CharacterRequirementsSystem _characterRequirements = default!;
[Dependency] private readonly PlayTimeTrackingManager _playTimeTracking = default!;
[Dependency] private readonly IConfigurationManager _configuration = default!;

public override void Initialize()
{
Expand All @@ -25,16 +34,17 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args)
{
foreach (var traitId in args.Profile.TraitPreferences)
{
if (!_prototypeManager.TryIndex<TraitPrototype>(traitId, out var traitPrototype))
if (!_prototype.TryIndex<TraitPrototype>(traitId, out var traitPrototype))
{
Log.Warning($"No trait found with ID {traitId}!");
return;
}

if (traitPrototype.Whitelist != null && !traitPrototype.Whitelist.IsValid(args.Mob))
continue;

if (traitPrototype.Blacklist != null && traitPrototype.Blacklist.IsValid(args.Mob))
if (!_characterRequirements.CheckRequirementsValid(traitPrototype, traitPrototype.Requirements,
_prototype.Index<JobPrototype>(args.JobId ?? _prototype.EnumeratePrototypes<JobPrototype>().First().ID),
args.Profile, _playTimeTracking.GetTrackerTimes(args.Player),
EntityManager, _prototype, _configuration,
out _))
continue;

// Add all components required by the prototype
Expand All @@ -43,22 +53,10 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args)
if (HasComp(args.Mob, entry.Component.GetType()))
continue;

var comp = (Component) _serializationManager.CreateCopy(entry.Component, notNullableOverride: true);
var comp = (Component) _serialization.CreateCopy(entry.Component, notNullableOverride: true);
comp.Owner = args.Mob;
EntityManager.AddComponent(args.Mob, comp);
}

// Add item required by the trait
if (traitPrototype.TraitGear != null)
{
if (!TryComp(args.Mob, out HandsComponent? handsComponent))
continue;

var coords = Transform(args.Mob).Coordinates;
var inhandEntity = EntityManager.SpawnEntity(traitPrototype.TraitGear, coords);
_sharedHandsSystem.TryPickup(args.Mob, inhandEntity, checkActionBlocker: false,
handsComp: handsComponent);
}
}
}
}
4 changes: 3 additions & 1 deletion Content.Server/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Actions.Events;
using Content.Shared.Administration.Components;
using Content.Shared.CombatMode;
using Content.Shared.Contests;
using Content.Shared.Damage.Events;
using Content.Shared.Damage.Systems;
using Content.Shared.Database;
Expand Down Expand Up @@ -43,6 +44,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SolutionContainerSystem _solutions = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly ContestsSystem _contests = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -138,7 +140,7 @@ protected override bool DoDisarm(EntityUid user, DisarmAttackEvent ev, EntityUid
if (attemptEvent.Cancelled)
return false;

var chance = CalculateDisarmChance(user, target, inTargetHand, combatMode);
var chance = CalculateDisarmChance(user, target, inTargetHand, combatMode) * _contests.MassContest(user, target);

if (_random.Prob(chance))
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Weapons/Ranged/Systems/FireOnDropSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void Initialize()

private void HandleLand(EntityUid uid, GunComponent component, ref ThrowDoHitEvent args)
{
if (_random.Prob(component.Reliability))
if (_random.Prob(component.FireOnDropChance))
_gun.AttemptShoot(uid, uid, component, Transform(uid).Coordinates.Offset(Transform(uid).LocalRotation.ToVec()));
}
}
9 changes: 6 additions & 3 deletions Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Server.Power.EntitySystems;
using Content.Server.Stunnable;
using Content.Server.Weapons.Ranged.Components;
using Content.Shared.Contests;
using Content.Shared.Damage;
using Content.Shared.Damage.Systems;
using Content.Shared.Database;
Expand Down Expand Up @@ -39,6 +40,7 @@ public sealed partial class GunSystem : SharedGunSystem
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly StaminaSystem _stamina = default!;
[Dependency] private readonly StunSystem _stun = default!;
[Dependency] private readonly ContestsSystem _contests = default!;

public const float DamagePitchVariation = SharedMeleeWeaponSystem.DamagePitchVariation;
public const float GunClumsyChance = 0.5f;
Expand Down Expand Up @@ -97,7 +99,7 @@ public override void Shoot(EntityUid gunUid, GunComponent gun, List<(EntityUid?
var toMap = toCoordinates.ToMapPos(EntityManager, TransformSystem);
var mapDirection = toMap - fromMap.Position;
var mapAngle = mapDirection.ToAngle();
var angle = GetRecoilAngle(Timing.CurTime, gun, mapDirection.ToAngle());
var angle = GetRecoilAngle(Timing.CurTime, gun, mapDirection.ToAngle(), user);

// If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
var fromEnt = MapManager.TryFindGridAt(fromMap, out var gridUid, out var grid)
Expand Down Expand Up @@ -311,15 +313,16 @@ private Angle[] LinearSpread(Angle start, Angle end, int intervals)
return angles;
}

private Angle GetRecoilAngle(TimeSpan curTime, GunComponent component, Angle direction)
private Angle GetRecoilAngle(TimeSpan curTime, GunComponent component, Angle direction, EntityUid? shooter)
{
var timeSinceLastFire = (curTime - component.LastFire).TotalSeconds;
var newTheta = MathHelper.Clamp(component.CurrentAngle.Theta + component.AngleIncreaseModified.Theta - component.AngleDecayModified.Theta * timeSinceLastFire, component.MinAngleModified.Theta, component.MaxAngleModified.Theta);
component.CurrentAngle = new Angle(newTheta);
component.LastFire = component.NextFire;

// Convert it so angle can go either side.
var random = Random.NextFloat(-0.5f, 0.5f);

var random = Random.NextFloat(-0.5f, 0.5f) / _contests.MassContest(shooter);
var spread = component.CurrentAngle.Theta * random;
var angle = new Angle(direction.Theta + component.CurrentAngle.Theta * random);
DebugTools.Assert(spread <= component.MaxAngleModified.Theta);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Zombies/ZombieSystem.Transform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
using Content.Shared.Weapons.Melee;
using Content.Shared.Zombies;
using Content.Shared.Prying.Components;
using Content.Shared.Traits.Assorted;
using Robust.Shared.Audio.Systems;
using Content.Shared.Traits.Assorted.Components;

namespace Content.Server.Zombies
{
Expand Down
48 changes: 46 additions & 2 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,34 @@ public static readonly CVarDef<bool>
public static readonly CVarDef<bool> DebugCoordinatesAdminOnly =
CVarDef.Create("game.debug_coordinates_admin_only", true, CVar.SERVER | CVar.REPLICATED);


/// <summary>
/// Whether to allow characters to select traits.
/// </summary>
public static readonly CVarDef<bool> GameTraitsEnabled =
CVarDef.Create("game.traits_enabled", true, CVar.REPLICATED);

/// <summary>
/// How many traits a character can have at most.
/// </summary>
public static readonly CVarDef<int> GameTraitsMax =
CVarDef.Create("game.traits_max", 5, CVar.REPLICATED);

/// <summary>
/// How many points a character should start with.
/// </summary>
public static readonly CVarDef<int> GameTraitsDefaultPoints =
CVarDef.Create("game.traits_default_points", 5, CVar.REPLICATED);


/// <summary>
/// Whether or not to allow characters to select loadout items.
/// Whether to allow characters to select loadout items.
/// </summary>
public static readonly CVarDef<bool> GameLoadoutsEnabled =
CVarDef.Create("game.loadouts_enabled", true, CVar.REPLICATED);

/// <summary>
/// How many points to give to each player for loadouts.
/// How many points to give to each player for loadouts.
/// </summary>
public static readonly CVarDef<int> GameLoadoutsPoints =
CVarDef.Create("game.loadouts_points", 14, CVar.REPLICATED);
Expand Down Expand Up @@ -2134,6 +2154,17 @@ public static readonly CVarDef<float>
CVarDef.Create("psionics.rolls_enabled", true, CVar.SERVERONLY);

/// <summary>
/// Whether height & width sliders adjust a character's Fixture Component
/// </summary>
public static readonly CVarDef<bool> HeightAdjustModifiesHitbox =
CVarDef.Create("heightadjust.modifies_hitbox", true, CVar.SERVERONLY);

/// <summary>
/// Whether height & width sliders adjust a player's view distance
/// </summary>
public static readonly CVarDef<bool> HeightAdjustModifiesZoom =
CVarDef.Create("heightadjust.modifies_zoom", true, CVar.SERVERONLY);

/// Enables station goals
/// </summary>
public static readonly CVarDef<bool> StationGoalsEnabled =
Expand All @@ -2144,5 +2175,18 @@ public static readonly CVarDef<float>
/// </summary>
public static readonly CVarDef<float> StationGoalsChance =
CVarDef.Create("game.station_goals_chance", 0.1f, CVar.SERVERONLY);

/// <summary>
/// Toggles all MassContest functions. All mass contests output 1f when false
/// </summary>
public static readonly CVarDef<bool> DoMassContests =
CVarDef.Create("contests.do_mass_contests", true, CVar.REPLICATED | CVar.SERVER);

/// <summary>
/// The maximum amount that Mass Contests can modify a physics multiplier, given as a +/- percentage
/// Default of 0.25f outputs between * 0.75f and 1.25f
/// </summary>
public static readonly CVarDef<float> MassContestsMaxPercentage =
CVarDef.Create("contests.max_percentage", 0.25f, CVar.REPLICATED | CVar.SERVER);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Content.Shared.Clothing.Loadouts.Prototypes;


/// <summary>
/// A prototype defining a valid category for <see cref="LoadoutPrototype"/>s to go into.
/// </summary>
Expand Down
Loading
Loading