Фиксы (#488)

* add material storage component to whitemoose

* fix pickaxe inventory size

* fix free sponsor only races

* invisible aghost no longer visible in ghost warp menu

* add migration for BoxTrashbag

* fix make wizard admin verb

* fixed wizard components swap and new wizard marks as wizard in ghost warp menu now

* Stop eating food if you drop it (#29854)

* Stop eating food if you drop it

* woops, unused param

* comments

---------

Co-authored-by: plykiya <plykiya@protonmail.com>

* Eating and Drinking Doafter Change (#30060)

My lawyer told me to do this

Co-authored-by: plykiya <plykiya@protonmail.com>

* ActivatableUI tweaks (#27448)

* ActivatableUI tweaks

* EntGotRemovedFromContainerMessage

* A

* Revert "ActivatableUI tweaks (#27448)"

This reverts commit 5b311c6fdbf77db6838bdcf9993b98272d4ebeac.

* fix eating food from containers

* fix double captain duffel

* add bible for chaplain loadout

* possible bad fix for double security headsets

---------

Co-authored-by: Plykiya <58439124+Plykiya@users.noreply.github.com>
Co-authored-by: plykiya <plykiya@protonmail.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
This commit is contained in:
ThereDrD0
2024-07-24 02:19:13 +03:00
committed by GitHub
parent a3ce41d6ea
commit 0d99c5afe7
12 changed files with 78 additions and 29 deletions

View File

@@ -462,6 +462,9 @@ namespace Content.Server.Ghost
if (HasComp<GlobalAntagonistComponent>(entity))
continue;
if (TryComp<InvisibilityComponent>(entity, out var invisibilityComponent) && invisibilityComponent.Invisible)
continue;
var playerDepartmentId = _prototypeManager.Index<DepartmentPrototype>("Specific").ID;
var playerJobName = "Неизвестно";

View File

@@ -16,6 +16,7 @@ using Content.Shared.Chemistry.Reagent;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
@@ -47,6 +48,7 @@ public sealed class DrinkSystem : SharedDrinkSystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly StomachSystem _stomach = default!;
@@ -155,6 +157,9 @@ public sealed class DrinkSystem : SharedDrinkSystem
_appearance.SetData(uid, FoodVisuals.Visual, drainAvailable.Float(), appearance);
}
/// <summary>
/// Tries to feed the drink item to the target entity
/// </summary>
private bool TryDrink(EntityUid user, EntityUid target, DrinkComponent drink, EntityUid item)
{
if (!HasComp<BodyComponent>(target))
@@ -209,9 +214,9 @@ public sealed class DrinkSystem : SharedDrinkSystem
BreakOnDamage = true,
MovementThreshold = 0.01f,
DistanceThreshold = 1.0f,
// Mice and the like can eat without hands.
// TODO maybe set this based on some CanEatWithoutHands event or component?
NeedHand = forceDrink,
// do-after will stop if item is dropped when trying to feed someone else
// or if the item started out in the user's own hands
NeedHand = forceDrink || _hands.IsHolding(user, item),
};
_doAfter.TryStartDoAfter(doAfterEventArgs);

View File

@@ -95,6 +95,9 @@ public sealed class FoodSystem : EntitySystem
args.Handled = result.Handled;
}
/// <summary>
/// Tries to feed the food item to the target entity
/// </summary>
public (bool Success, bool Handled) TryFeed(EntityUid user, EntityUid target, EntityUid food, FoodComponent foodComp)
{
//Suppresses eating yourself and alive mobs
@@ -185,9 +188,9 @@ public sealed class FoodSystem : EntitySystem
BreakOnDamage = true,
MovementThreshold = 0.01f,
DistanceThreshold = MaxFeedDistance,
// Mice and the like can eat without hands.
// TODO maybe set this based on some CanEatWithoutHands event or component?
NeedHand = forceFeed,
// do-after will stop if item is dropped when trying to feed someone else
// or if the item started out in the user's own hands
NeedHand = forceFeed || _hands.IsHolding(user, food),
};
_doAfter.TryStartDoAfter(doAfterArgs);

View File

@@ -20,6 +20,7 @@ using Content.Server.Mind;
using Content.Server.Singularity.EntitySystems;
using Content.Server.Standing;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared._White.Antag;
using Content.Shared._White.BetrayalDagger;
using Content.Shared._White.Cult.Components;
using Content.Shared._White.Events;
@@ -184,6 +185,7 @@ public sealed class WizardSpellsSystem : EntitySystem
SwapComponent<HeadRevolutionaryComponent>(uid, target);
SwapComponent<PentagramComponent>(uid, target);
SwapComponent<CultistComponent>(uid, target);
SwapComponent<GlobalAntagonistComponent>(uid, target);
_mindSystem.TransferTo(mindId, target, mind: mind);
@@ -195,6 +197,10 @@ public sealed class WizardSpellsSystem : EntitySystem
TransferAllMagicActions(uid, target);
// This is bad, but EnsureComp cant copy variables
if (TryComp<GlobalAntagonistComponent>(target, out var globalAntagonistComponent))
globalAntagonistComponent.AntagonistPrototype = "globalAntagonistWizard";
_standing.TryLieDown(uid);
_standing.TryLieDown(target);
@@ -947,24 +953,26 @@ public sealed class WizardSpellsSystem : EntitySystem
}
}
private void SwapComponent<T>(EntityUid uid1, EntityUid uid2) where T : Component, new()
private void SwapComponent<T>(EntityUid uidFrom, EntityUid uidTo) where T : Component, new()
{
var hasComp = HasComp<T>(uid1);
var targetHasComp = HasComp<T>(uid2);
var hasComp = HasComp<T>(uidFrom);
var targetHasComp = HasComp<T>(uidTo);
if (hasComp == targetHasComp)
return;
if (hasComp)
{
EnsureComp<T>(uid2);
RemComp<T>(uid1);
EnsureComp<T>(uidTo);
RemComp<T>(uidFrom);
return;
}
if (targetHasComp)
if (!targetHasComp)
{
EnsureComp<T>(uid1);
RemComp<T>(uid2);
EnsureComp<T>(uidFrom);
RemComp<T>(uidTo);
}
}

View File

@@ -439,7 +439,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
if (HasComp<WizardComponent>(uid))
return;
MakeWizard(uid, rule, true);
MakeWizard(uid, rule);
}
private bool MakeWizard(EntityUid wizard, WizardRuleComponent rule,
@@ -468,7 +468,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return false;
}
if (!SpawnMap((wizard, rule)))
if (!SpawnMap((rule.Owner, rule)))
{
_sawmill.Info("Failed to load shuttle for wizard");
return false;

View File

@@ -227,9 +227,17 @@ public abstract partial class SharedHandsSystem
return true;
}
public bool IsHolding(EntityUid uid, EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, HandsComponent? handsComp = null)
public bool IsHolding(Entity<HandsComponent?> entity, [NotNullWhen(true)] EntityUid? item)
{
return IsHolding(entity, item, out _, entity);
}
public bool IsHolding(EntityUid uid, [NotNullWhen(true)] EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, HandsComponent? handsComp = null)
{
inHand = null;
if (entity == null)
return false;
if (!Resolve(uid, ref handsComp, false))
return false;
@@ -241,7 +249,6 @@ public abstract partial class SharedHandsSystem
return true;
}
}
return false;
}

View File

@@ -201,16 +201,31 @@ namespace Content.Shared.Preferences
}
// TODO: This should eventually not be a visual change only.
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null)
public static HumanoidCharacterProfile Random(HashSet<string>? ignoredSpecies = null, bool includeSponsor = false)
{
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var random = IoCManager.Resolve<IRobustRandom>();
// WD edit - fix free sponsor species
var speciesToIgnore = ignoredSpecies != null
? new HashSet<string>(ignoredSpecies)
: new HashSet<string>();
if (!includeSponsor)
{
var sponsorSpecies = prototypeManager.EnumeratePrototypes<SpeciesPrototype>()
.Where(x => x.SponsorOnly)
.Select(x => x.ID);
speciesToIgnore.UnionWith(sponsorSpecies);
}
var species = random.Pick(prototypeManager
.EnumeratePrototypes<SpeciesPrototype>()
.Where(x => ignoredSpecies == null ? x.RoundStart : x.RoundStart && !ignoredSpecies.Contains(x.ID))
.Where(x => !x.SponsorOnly && x.RoundStart && !speciesToIgnore.Contains(x.ID))
.ToArray()
).ID;
// WD edit end
return RandomWithSpecies(species);
}

View File

@@ -9545,6 +9545,7 @@ entities:
- type: NavMap
- type: BecomesStation
id: WhiteMooseStation
- type: MaterialStorage
- uid: 3058
components:
- type: MetaData
@@ -77108,7 +77109,7 @@ entities:
- stampedColor: '#006600FF'
stampedName: stamp-component-stamped-name-centcom
content: >-
Совместная работа отделов повышает эффективность всех сотрудников. Попроси помощи и помоги другим и увидишь, как тебе проще стало летать в космос. Грабеж и хамство последнее, что ты должен делать.
Совместная работа отделов повышает эффективность всех сотрудников. Попроси помощи и помоги другим и увидишь, как тебе проще стало летать в космос. Грабеж и хамство последнее, что ты должен делать.

View File

@@ -32,7 +32,7 @@
size: Normal
shape:
- 0,0,2,0
- 1,1,1,2
- 1,1,1,1
sprite: Objects/Weapons/Melee/pickaxe.rsi
storedRotation: -45
- type: UseDelay

View File

@@ -195,6 +195,15 @@
back:
- ArmamentsBeacon
- type: itemLoadout # WD
id: Bible
equipment: Bible
- type: startingGear
id: Bible
storage:
back:
- Bible
# PDA
- type: itemLoadout # WD

View File

@@ -67,7 +67,6 @@
- CaptainBackpack
- CaptainSatchel
- CaptainDuffel
- CaptainDuffel
- CommonSatchelLeather # WD
- type: loadoutGroup
@@ -374,8 +373,11 @@
- type: loadoutGroup # WD edit
id: ChaplainJobTrinkets
name: loadout-group-job-trinkets
minLimit: 2
maxLimit: 2
loadouts:
- ArmamentsBeacon
- Bible
- type: loadoutGroup
id: ChaplainPDA
@@ -1590,12 +1592,6 @@
- BlackTie
- RedTie
- type: loadoutGroup # WD
id: CommonSecurityHeadset
name: loadout-group-ears
loadouts:
- SecurityHeadset
- type: loadoutGroup # WD
id: CommonSecurityCommandHeadset
name: loadout-group-ears

View File

@@ -267,3 +267,5 @@ ComfyChairEngineering: OrangeComfyChair
ComfyChairScience: PurpleComfyChair
ComfyChairCargo: BrownComfyChair
ComfyChairService: GreenComfyChair
BoxTrashbag: TrashBag