* - fix: Ling fixes.

* - fix: Fix ghasp identity.

* - fix: Low temp slowdown fix.

* - fix: Crossbow fix.

* - fix: Fix gamerules.

* - fix: Fix shadow shackles.

* - fix: Cleanup refund.

* - fix: Can't pry runic door.

* - fix: Fix crash.

* - fix: Fix mood.

* - fix: Fix dictionary.
This commit is contained in:
Aviu00
2024-04-22 00:07:27 +09:00
committed by GitHub
parent bf0a124b05
commit 6272da2bb3
20 changed files with 115 additions and 47 deletions

View File

@@ -6,6 +6,7 @@ using Content.Server.Bible.Components;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Rules;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.NPC.Systems;
using Content.Server.Roles;
using Content.Server.Roles.Jobs;
@@ -27,6 +28,7 @@ using Robust.Shared.Random;
using Content.Shared._White;
using Content.Shared._White.Cult.Components;
using Content.Shared._White.Cult.Systems;
using Content.Shared._White.Mood;
using Content.Shared.Mind;
using Content.Shared.NPC.Systems;
using Robust.Server.Player;
@@ -74,6 +76,13 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
SubscribeLocalEvent<CultistRoleComponent, GetBriefingEvent>(OnGetBriefing);
}
protected override void Added(EntityUid uid, CultRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
{
base.Added(uid, component, gameRule, args);
gameRule.MinPlayers = _cfg.GetCVar(WhiteCVars.CultMinPlayers);
}
private void OnGetBriefing(Entity<CultistRoleComponent> ent, ref GetBriefingEvent args)
{
args.Append(Loc.GetString("cult-role-briefing-short"));
@@ -149,9 +158,11 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
cult.CurrentCultists.Add(component);
if (TryComp<ActorComponent>(uid, out var actor))
var name = Name(uid);
if (TryComp<ActorComponent>(uid, out var actor) && !cult.CultistsCache.ContainsKey(name))
{
cult.CultistsCache.Add(MetaData(uid).EntityName, actor.PlayerSession.Name);
cult.CultistsCache.Add(name, actor.PlayerSession.Name);
}
UpdateCultistsAppearance(cult);
@@ -187,10 +198,8 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
private void DoCultistsStart(CultRuleComponent rule)
{
var eligiblePlayers =
_antagSelection.GetEligiblePlayers(_playerManager.Sessions, rule.CultistRolePrototype);
eligiblePlayers.RemoveAll(HasComp<BibleUserComponent>);
var eligiblePlayers = _antagSelection.GetEligiblePlayers(_playerManager.Sessions, rule.CultistRolePrototype,
customExcludeCondition: HasComp<BibleUserComponent>);
if (eligiblePlayers.Count == 0)
{
@@ -357,7 +366,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
MakeCultist(entity, cultistRule);
}
public bool MakeCultist(EntityUid cultist, CultRuleComponent rule)
{
if (!_mindSystem.TryGetMind(cultist, out var mindId, out var mind))
@@ -385,6 +394,8 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
_factionSystem.RemoveFaction(cultist, "NanoTrasen", false);
_factionSystem.AddFaction(cultist, "Cultist");
RaiseLocalEvent(cultist, new MoodEffectEvent("CultFocused"));
if (_inventorySystem.TryGetSlotEntity(cultist, "back", out var backPack))
{
foreach (var itemPrototype in rule.StartingItems)
@@ -420,4 +431,4 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
EnsureComp<CultistComponent>(transferTo);
RemComp<CultistComponent>(transferFrom);
}
}
}

View File

@@ -7,6 +7,7 @@ using Content.Shared.Chemistry.Reagent;
using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared._White.Cult.Components;
using Content.Shared._White.Mood;
using Content.Shared.Mind;
using JetBrains.Annotations;
using Robust.Server.Containers;
@@ -86,5 +87,7 @@ public sealed partial class DeconvertCultist : ReagentEffect
if (roleSystem.MindHasRole<CultistRoleComponent>(mindId))
roleSystem.MindRemoveRole<CultistRoleComponent>(mindId);
entityManager.EventBus.RaiseLocalEvent(uid, new MoodRemoveEffectEvent("CultFocused"));
}
}

View File

@@ -20,6 +20,7 @@ using Content.Shared._White.Cult.Components;
using Content.Shared._White.Cult.Systems;
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
using Content.Shared.Cuffs;
using Content.Shared.Cuffs.Components;
using Content.Shared.DoAfter;
using Content.Shared.Maps;
@@ -79,8 +80,14 @@ public partial class CultSystem
return;
var cuffs = Spawn("ShadowShackles", Transform(ent).Coordinates);
if (!_cuffable.TryAddNewCuffs(args.Target.Value, args.User, cuffs, cuffable))
QueueDel(cuffs);
var handcuffComponent = EnsureComp<HandcuffComponent>(cuffs);
if (_cuffable.TryAddNewCuffs(args.Target.Value, args.User, cuffs, cuffable, handcuffComponent))
{
SharedCuffableSystem.SetUsed(handcuffComponent, true);
return;
}
QueueDel(cuffs);
}
private void OnActionRemoved(Entity<CultistComponent> ent, ref ActionGettingRemovedEvent args)
@@ -493,4 +500,4 @@ public partial class CultSystem
_handsSystem.TryPickupAnyHand(args.Performer, dagger);
args.Handled = true;
}
}
}

View File

@@ -9,6 +9,7 @@ using Content.Shared._White.Cult.Systems;
using Content.Shared.Cuffs.Components;
using Content.Shared.Doors.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Prying.Components;
using Content.Shared.Weapons.Melee.Components;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
@@ -38,6 +39,12 @@ public sealed class RunicDoorSystem : EntitySystem
SubscribeLocalEvent<RunicDoorComponent, BeforeDoorClosedEvent>(OnBeforeDoorClosed);
// SubscribeLocalEvent<RunicDoorComponent, AttackedEvent>(OnGetAttacked);
SubscribeLocalEvent<RunicDoorComponent, ConcealEvent>(OnConceal);
SubscribeLocalEvent<RunicDoorComponent, BeforePryEvent>(OnBeforePry);
}
private void OnBeforePry(Entity<RunicDoorComponent> ent, ref BeforePryEvent args)
{
args.Cancelled = true;
}
private void OnConceal(Entity<RunicDoorComponent> ent, ref ConcealEvent args)
@@ -112,7 +119,7 @@ public sealed class RunicDoorSystem : EntitySystem
return true;
}
_doorSystem.Deny(airlock);
// _doorSystem.Deny(airlock);
if (!HasComp<HumanoidAppearanceComponent>(user) || _holyWeapon.IsHoldingHolyWeapon(user) ||
TryComp(airlock, out ConcealableComponent? concealable) && concealable.Concealed)