mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
+33









deltanedas
Justin
Psychpsyo
Psychpsyo
slarticodefast
SlamBamActionman
chromiumboy
ShadowCommander
Chief-Engineer
deathride58
deltanedas
PJBot
BramvanZijp
Ilya246
Moomoobeef
Saphire Lattice
FluffMe
Theodore Lukin
August Sun
august-sun
lzk
metalgearsloth
Preston Smith
Milon
Flareguy
Alzore
Boaz1111
Jarmer123
SpaceLizard
PopGamer46
RumiTiger
ScarKy0
Minemoder5000
UBlueberry
Brandon Li
Vasilis
K-Dynamic
Ubaser
AftrLite
nikthechampiongr
Centronias
joshepvodka
Scribbles0
2620eb48a8
* Fix multiplying colors of differing nullabilities (#32991) * revert the temporary hack * Make atmos alert computer colors private variables (#32992) * Add flash reaction effect (#32377) add flash reaction effect * Automatic changelog update * Fix loneop spawnrate by reverting it to not use the shuttle event system. (#32942) Fix loneop spawnrate by reverting it to not use the custom shuttle event system. * Automatic changelog update * add atmosia to devmap (#32460) change * bowls now make drinking sounds (#32819) * Automatic changelog update * Add health analyzer unrevivability warning (#32636) * Add health analyzer unrevivability warning * Remove errornous comment * Automatic changelog update * Removed the name "Hujsak" (#32998) removed hujsak * fix pie throwing sound not playing (#33017) * Automatic changelog update * Fix TestSuicideByHeldItem and TestSuicideByHeldItemSpreadDamage (#33030) * make ai speak robotically (#33025) * Automatic changelog update * Extends the minimum round time for meteor swarm events (#32876) * adjusted minimum timers in meteorswarms.yml * Updated timer minimum from 20 to 15 minutes * Reduced minimum timer to 10 minutes as a result of other meteor changes --------- Co-authored-by: august-sun <45527070+august.sun@users.noreply.github.com> * Automatic changelog update * add StartDelay bool to actions (#33026) * add StartDelay bool to actions * forgot summary * Updated an incorrect sprite in the smite menu (#33043) changed the synth sprite used in the icon for the instrumentify smite out for the more accurate supersynth sprite * fix lava expeds (#33042) Co-authored-by: deltanedas <@deltanedas:kde.org> * Automatic changelog update * Fix separated game screen bumping (#33046) I don't really understand why RecordedSplitContainer exists but removing it looks identical and fixes the panel bumping occasionally. * Automatic changelog update * Fix: Make Plushie Damage Unexaminable (#33061) Set hidden to true * fix chameleon projector bot whitelist (#33055) fix * Various Vaugely Connected Sprite Updates™: Encryption Keys, Station Map, Brig Timer (#32786) * various resprites (encryption keys + signal screens + station map) * brig timer update * fixes n shit * Give proto-kinetic crushers, glaives, and daggers better inhands. Update the crusher and glaive icons. (#32212) * inhands * better inhands * indent * Automatic changelog update * Make the security belt contain more useful items by default (#32291) * replace tear gas and flashbang with holobarrier and sec radio * holobarrier-belt-fix * revert changes of 32291 * Automatic changelog update * Add 3 bottle boxes to nanomed plus (#33018) three bottle boxes in nanomed plus * Automatic changelog update * Nukie med bundle now costs 24 tc and contains a unique defibrillator (#32720) * a-few-injectors * comment * defib-ops-when * Automatic changelog update * Pill Bottles can only store pills now (#33074) * no longer absurd * Update Resources/Prototypes/Entities/Objects/Specific/chemistry.yml --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Automatic changelog update * Add a spare bible to PietyVend (#32363) Update chapel.yml * Automatic changelog update * [#28722 fix] Add notification for dependent wearables being dropped (#33078) * add notification for dependent wearables being dropped * fix dropped item popup redundancy - did a check to see if any item was dropped, instead of making a notification for each item being dropped. * change popup to client-only variant * fix redundant messages, add plural locale string * fix conventions, fix locale input to be more intuitive --------- Co-authored-by: Justin <justinbrick1@gmail.com> * Automatic changelog update * More pda space (#32601) * Rebalance the max programs that a PDA can hold * Give Caps PDA more programs too. * Make the max programs a static 8 * I forgor sec and med * CaseCase * Empty commit to re-run checks * The final change, I hope. * Automatic changelog update * Fixed spelling mistake in water blaster description. (#33087) Fixed minor spelling mistake * [#20285 fix] Carp Plush and Rehydratables can now be put into mop bucket (#33079) * Make shark plush janitor-bucketable * fix bucketed grey shark texture * Make sprites less shiny and adapt copyright notice * Made shark way way less shiny * Allow carp plush and rehydratables in mop bucket. * Remove old mop bucket shark sprites * Fix post-merge bugs * Fix errors * Move ReactiveContainer stuff to shared That should mean it is now predicted. * Custom eject verb for the mop bucket * Fixes OnSolutionChange, removes pop-up as there already is one. * .ftl is not necessary as the custom pop-up was removed * Review fixes * Update Content.Shared/Chemistry/Components/ReactiveContainerComponent.cs * Update Content.Shared/Chemistry/EntitySystems/ReactiveContainerSystem.cs --------- Co-authored-by: Psychpsyo <psychpsyo@gmail.com> Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Automatic changelog update * remove now duplicated nyano PlushieCarp tag * Fixes tailthump breaking positional audio by making it mono (#33092) * Automatic changelog update * ExaminableDamage now puts its message at the bottom and in color (#32820) * the examineableDamage component now puts its messages at the bottom, and in color * god help us if something is priority -100 :godo: * Automatic changelog update * Lower in-round votekick requirements (#32953) Initial commit * Allow votekicks to be initiated in the lobby (#32528) Initial commit * Automatic changelog update * Fixes bolt lights of previously unpowered bolted doors (#33063) fix * Automatic changelog update * Muffins (#29318) * Update meta.json * Add files via upload * Update misc.yml * Update meal_recipes.yml * Update meta.json * Add files via upload * Update plate.yml * Update food_baked_single.yml * Update dinnerware.yml * Update cooking.yml * Update misc.yml * Add files via upload * Delete Resources/Textures/Objects/Consumable/Food/Baked/misc.rsi/muffin-cherry.png * Add files via upload * Update meta.json * Update misc.yml * Update meal_recipes.yml * Update meta.json * Fix meta.json * Fix meta.json again * Update misc.yml * Update misc.yml * Update misc.yml * Update misc.yml * Update meta.json * Update meta.json * Update misc.yml * Update meal_recipes.yml * Update Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/misc.yml Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Update dinnerware.yml * Delete cherry * Add files via upload * Delete banana * Add banana * Delete chocolate * Add chocolate * lathe recipe fix --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Automatic changelog update * Borgs can no longer see mindshield + AI can no longer toggle off seeing job icons (#33069) * :( * Removed the sprite + updated RSI * Automatic changelog update * Add CanLoad for biomes (#33050) CPUJob to come later. * Remove CargoPallet component from the cargo pallet (#33022) * Change cargo shuttle pallets to catwalks. * Remove CargoPallet component from the cargo pallet. * Undo cargo shuttle changes. * Automatic changelog update * Minor antagonist guidebook changes (#32824) * took a two month nap. accidentally pushed too many buttons. let's try this again. added thieves to antagonists.xml * even after that nap, i don't feel well-rested at all. * please don't kill me for using webedit * capitalization, typo * Apply suggestions from code review (more period moving) Thanks Evan, very cool Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * guess you could say im not pro-proper noun * typo * Update Resources/ServerInfo/Guidebook/Antagonist/Nuclear Operatives.xml * ok Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Give Nukies a Hand Labeler (#33053) * Add hand-labeler to nukie planet * Rearrange nukie chem table * Fix `ItemSlotSystem` popup Logic (#28856) * move popup call out of `CanInsert` into `OnInteractUsing` * im stupid and `reason` is completely unnecessary Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com> * return early when `itemSlots.Slots.Count == 0` * tweak logic for triggering popups * change popup logic again * Consolidate whitelist check * Get any popup message not just last failed slot * Apply suggestions from code review Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com> * yoink Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> --------- Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com> Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com> * Add cvars to votekick to customize requirements for the initiator. (#32490) * Automatic changelog update * Add on-call functionality for adminning (#30443) * Add on-call functionality for adminning The first time an ahelp gets SOS it gets relayed to the specified channel with the specified ping. Every time after that it doesn't until it gets a non-SOS response received. * Remove redundant name Pretty sure this already gets chucked on the name of the msg itself I think it just didn't show in screenshot because they were subsequent. * Update Content.Server/Administration/Systems/BwoinkSystem.cs Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> --------- Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Co-authored-by: deathride58 <deathride58@users.noreply.github.com> * Automatic changelog update * Pills are explosion resistant (partially reverts #15851) (#32458) * idk how to revert a pr so I just deleted some lines * pill destructible with explosion resistance * comment for explosion resist * "and" to "but" --------- Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Automatic changelog update * Hasten handcraft gauze recipe & decrease techfab gauze cost (#32744) * med lathe gauze price reduction * gauze craft doafter time * 3 second doafter craft * Automatic changelog update * Service workers antagonist fix. (#31359) * add * Revert "add" This reverts commit 25da34b0fead5812fe5800c9bf5dd7b10ef48d7d. * antagonism allowed™️ * Automatic changelog update * Adds a new AME sound effect! (#33097) * Changes the AME sound effect to not be the default MetalThud. * Was told on discord to make a minor change to autorerun the tests due to the Build & Test Debug failing! * Attribution and licensing, as requsted by deathride58 * Fixes the high-pitched squeak audible to some people! * Audio file tweaked by SlamBamActionMan to eliminate a weird squeak they were still able to hear. Thanks! * Automatic changelog update * Allow for the ai's laws to be changed from its core and eye (#32461) * Allow for the ai's laws to be changed from its core and eye * Address reviews * Automatic changelog update * clean up tools lathe recipes (#31521) * clean up tools lathe recipes * add medical and cooking tools * add result * add result to others * review * engine --------- Co-authored-by: deltanedas <@deltanedas:kde.org> * Automatic changelog update * Intercoms and Radios both pick up proximate speech (#32737) * Deduping of recent messages should consider the channel it's being sent to * rerun actions * Automatic changelog update * Adds headphones to loadouts (#33067) added headphones to trinkets * Automatic changelog update * Cardboard Box Capacity 4 -> 5 (#32743) * capacity upgrade * comment update * remove our duplicate pill whitelist * fix * remove broken crew monitor from dev map, how did it even get there --------- Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com> Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com> Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: PJBot <pieterjan.briers+bot@gmail.com> Co-authored-by: BramvanZijp <56019239+BramvanZijp@users.noreply.github.com> Co-authored-by: Ilya246 <57039557+Ilya246@users.noreply.github.com> Co-authored-by: Moomoobeef <62638182+Moomoobeef@users.noreply.github.com> Co-authored-by: Saphire Lattice <lattice@saphi.re> Co-authored-by: FluffMe <1780586+FluffMe@users.noreply.github.com> Co-authored-by: Theodore Lukin <66275205+pheenty@users.noreply.github.com> Co-authored-by: August Sun <45527070+august-sun@users.noreply.github.com> Co-authored-by: august-sun <45527070+august.sun@users.noreply.github.com> Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Preston Smith <92108534+thetolbean@users.noreply.github.com> Co-authored-by: Milon <plmilonpl@gmail.com> Co-authored-by: Flareguy <78941145+Flareguy@users.noreply.github.com> Co-authored-by: Alzore <140123969+Blackern5000@users.noreply.github.com> Co-authored-by: Boaz1111 <149967078+Boaz1111@users.noreply.github.com> Co-authored-by: Jarmer123 <148848017+Jarmer123@users.noreply.github.com> Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Co-authored-by: Justin <justinbrick1@gmail.com> Co-authored-by: SpaceLizard <the.justice.league.of.canada@gmail.com> Co-authored-by: Psychpsyo <psychpsyo@gmail.com> Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com> Co-authored-by: deathride58 <deathride58@users.noreply.github.com> Co-authored-by: PopGamer46 <yt1popgamer@gmail.com> Co-authored-by: RumiTiger <154005209+RumiTiger@users.noreply.github.com> Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Co-authored-by: Minemoder5000 <minemoder50000@gmail.com> Co-authored-by: UBlueberry <161545003+UBlueberry@users.noreply.github.com> Co-authored-by: Brandon Li <48413902+aspiringLich@users.noreply.github.com> Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: Vasilis <vasilis@pikachu.systems> Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Co-authored-by: K-Dynamic <20566341+K-Dynamic@users.noreply.github.com> Co-authored-by: Ubaser <134914314+UbaserB@users.noreply.github.com> Co-authored-by: AftrLite <61218133+AftrLite@users.noreply.github.com> Co-authored-by: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Co-authored-by: Centronias <me@centronias.com> Co-authored-by: joshepvodka <86210200+joshepvodka@users.noreply.github.com> Co-authored-by: Scribbles0 <91828755+Scribbles0@users.noreply.github.com>
632 lines
28 KiB
C#
632 lines
28 KiB
C#
using Content.Server.Administration.Logs;
|
|
using Content.Server.Administration.Managers;
|
|
using Content.Server.Administration.UI;
|
|
using Content.Server.Disposal.Tube;
|
|
using Content.Server.Disposal.Tube.Components;
|
|
using Content.Server.EUI;
|
|
using Content.Server.GameTicking;
|
|
using Content.Server.Ghost.Roles;
|
|
using Content.Server.Mind;
|
|
using Content.Server.Mind.Commands;
|
|
using Content.Server.Prayer;
|
|
using Content.Server.Station.Systems;
|
|
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
|
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Chemistry.Components.SolutionManager;
|
|
using Content.Shared.Chemistry.EntitySystems;
|
|
using Content.Shared.Configurable;
|
|
using Content.Shared.Database;
|
|
using Content.Shared.Examine;
|
|
using Content.Shared.GameTicking;
|
|
using Content.Shared.Inventory;
|
|
using Content.Shared.Mind.Components;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Verbs;
|
|
using Robust.Server.Console;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.Console;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
using Robust.Shared.Player;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Timing;
|
|
using Robust.Shared.Toolshed;
|
|
using Robust.Shared.Utility;
|
|
using System.Linq;
|
|
using Content.Server.Silicons.Laws;
|
|
using Content.Shared.Movement.Components;
|
|
using Content.Shared.Silicons.Laws.Components;
|
|
using Robust.Server.Player;
|
|
using Content.Shared.Silicons.StationAi;
|
|
using Robust.Shared.Physics.Components;
|
|
using static Content.Shared.Configurable.ConfigurationComponent;
|
|
|
|
namespace Content.Server.Administration.Systems
|
|
{
|
|
/// <summary>
|
|
/// System to provide various global admin/debug verbs
|
|
/// </summary>
|
|
public sealed partial class AdminVerbSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly IConGroupController _groupController = default!;
|
|
[Dependency] private readonly IConsoleHost _console = default!;
|
|
[Dependency] private readonly IAdminManager _adminManager = default!;
|
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
[Dependency] private readonly AdminSystem _adminSystem = default!;
|
|
[Dependency] private readonly DisposalTubeSystem _disposalTubes = default!;
|
|
[Dependency] private readonly EuiManager _euiManager = default!;
|
|
[Dependency] private readonly GameTicker _ticker = default!;
|
|
[Dependency] private readonly GhostRoleSystem _ghostRoleSystem = default!;
|
|
[Dependency] private readonly ArtifactSystem _artifactSystem = default!;
|
|
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
|
[Dependency] private readonly PrayerSystem _prayerSystem = default!;
|
|
[Dependency] private readonly MindSystem _mindSystem = default!;
|
|
[Dependency] private readonly ToolshedManager _toolshed = default!;
|
|
[Dependency] private readonly RejuvenateSystem _rejuvenate = default!;
|
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
|
[Dependency] private readonly StationSystem _stations = default!;
|
|
[Dependency] private readonly StationSpawningSystem _spawning = default!;
|
|
[Dependency] private readonly ExamineSystemShared _examine = default!;
|
|
[Dependency] private readonly AdminFrozenSystem _freeze = default!;
|
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
|
[Dependency] private readonly SiliconLawSystem _siliconLawSystem = default!;
|
|
|
|
private readonly Dictionary<ICommonSession, List<EditSolutionsEui>> _openSolutionUis = new();
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<GetVerbsEvent<Verb>>(GetVerbs);
|
|
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
|
|
SubscribeLocalEvent<SolutionContainerManagerComponent, SolutionContainerChangedEvent>(OnSolutionChanged);
|
|
}
|
|
|
|
private void GetVerbs(GetVerbsEvent<Verb> ev)
|
|
{
|
|
AddAdminVerbs(ev);
|
|
AddDebugVerbs(ev);
|
|
AddSmiteVerbs(ev);
|
|
AddTricksVerbs(ev);
|
|
AddAntagVerbs(ev);
|
|
}
|
|
|
|
private void AddAdminVerbs(GetVerbsEvent<Verb> args)
|
|
{
|
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
|
return;
|
|
|
|
var player = actor.PlayerSession;
|
|
|
|
if (_adminManager.IsAdmin(player))
|
|
{
|
|
Verb mark = new();
|
|
mark.Text = Loc.GetString("toolshed-verb-mark");
|
|
mark.Message = Loc.GetString("toolshed-verb-mark-description");
|
|
mark.Category = VerbCategory.Admin;
|
|
mark.Act = () => _toolshed.InvokeCommand(player, "=> $marked", Enumerable.Repeat(args.Target, 1), out _);
|
|
mark.Impact = LogImpact.Low;
|
|
args.Verbs.Add(mark);
|
|
|
|
if (TryComp(args.Target, out ActorComponent? targetActor))
|
|
{
|
|
// AdminHelp
|
|
Verb verb = new();
|
|
verb.Text = Loc.GetString("ahelp-verb-get-data-text");
|
|
verb.Category = VerbCategory.Admin;
|
|
verb.Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/gavel.svg.192dpi.png"));
|
|
verb.Act = () =>
|
|
_console.RemoteExecuteCommand(player, $"openahelp \"{targetActor.PlayerSession.UserId}\"");
|
|
verb.Impact = LogImpact.Low;
|
|
args.Verbs.Add(verb);
|
|
|
|
// Subtle Messages
|
|
Verb prayerVerb = new();
|
|
prayerVerb.Text = Loc.GetString("prayer-verbs-subtle-message");
|
|
prayerVerb.Category = VerbCategory.Admin;
|
|
prayerVerb.Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/pray.svg.png"));
|
|
prayerVerb.Act = () =>
|
|
{
|
|
_quickDialog.OpenDialog(player, "Subtle Message", "Message", "Popup Message", (string message, string popupMessage) =>
|
|
{
|
|
_prayerSystem.SendSubtleMessage(targetActor.PlayerSession, player, message, popupMessage == "" ? Loc.GetString("prayer-popup-subtle-default") : popupMessage);
|
|
});
|
|
};
|
|
prayerVerb.Impact = LogImpact.Low;
|
|
args.Verbs.Add(prayerVerb);
|
|
|
|
// Spawn - Like respawn but on the spot.
|
|
args.Verbs.Add(new Verb()
|
|
{
|
|
Text = Loc.GetString("admin-player-actions-spawn"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () =>
|
|
{
|
|
if (!_transformSystem.TryGetMapOrGridCoordinates(args.Target, out var coords))
|
|
{
|
|
_popup.PopupEntity(Loc.GetString("admin-player-spawn-failed"), args.User, args.User);
|
|
return;
|
|
}
|
|
|
|
var stationUid = _stations.GetOwningStation(args.Target);
|
|
|
|
var profile = _ticker.GetPlayerProfile(targetActor.PlayerSession);
|
|
var mobUid = _spawning.SpawnPlayerMob(coords.Value, null, profile, stationUid);
|
|
var targetMind = _mindSystem.GetMind(args.Target);
|
|
|
|
if (targetMind != null)
|
|
{
|
|
_mindSystem.TransferTo(targetMind.Value, mobUid, true);
|
|
}
|
|
},
|
|
ConfirmationPopup = true,
|
|
Impact = LogImpact.High,
|
|
});
|
|
|
|
// Clone - Spawn but without the mind transfer, also spawns at the user's coordinates not the target's
|
|
args.Verbs.Add(new Verb()
|
|
{
|
|
Text = Loc.GetString("admin-player-actions-clone"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () =>
|
|
{
|
|
if (!_transformSystem.TryGetMapOrGridCoordinates(args.User, out var coords))
|
|
{
|
|
_popup.PopupEntity(Loc.GetString("admin-player-spawn-failed"), args.User, args.User);
|
|
return;
|
|
}
|
|
|
|
var stationUid = _stations.GetOwningStation(args.Target);
|
|
|
|
var profile = _ticker.GetPlayerProfile(targetActor.PlayerSession);
|
|
_spawning.SpawnPlayerMob(coords.Value, null, profile, stationUid);
|
|
},
|
|
ConfirmationPopup = true,
|
|
Impact = LogImpact.High,
|
|
});
|
|
|
|
// PlayerPanel
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Text = Loc.GetString("admin-player-actions-player-panel"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () => _console.ExecuteCommand(player, $"playerpanel \"{targetActor.PlayerSession.UserId}\""),
|
|
Impact = LogImpact.Low
|
|
});
|
|
}
|
|
|
|
if (_mindSystem.TryGetMind(args.Target, out _, out var mind) && mind.UserId != null)
|
|
{
|
|
// Erase
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Text = Loc.GetString("admin-verbs-erase"),
|
|
Message = Loc.GetString("admin-verbs-erase-description"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(
|
|
new("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
_adminSystem.Erase(mind.UserId.Value);
|
|
},
|
|
Impact = LogImpact.Extreme,
|
|
ConfirmationPopup = true
|
|
});
|
|
|
|
// Respawn
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Text = Loc.GetString("admin-player-actions-respawn"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () =>
|
|
{
|
|
_console.ExecuteCommand(player, $"respawn \"{mind.UserId}\"");
|
|
},
|
|
ConfirmationPopup = true,
|
|
// No logimpact as the command does it internally.
|
|
});
|
|
}
|
|
|
|
// Freeze
|
|
var frozen = TryComp<AdminFrozenComponent>(args.Target, out var frozenComp);
|
|
var frozenAndMuted = frozenComp?.Muted ?? false;
|
|
|
|
if (!frozen)
|
|
{
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze.
|
|
Text = Loc.GetString("admin-verbs-freeze"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
EnsureComp<AdminFrozenComponent>(args.Target);
|
|
},
|
|
Impact = LogImpact.Medium,
|
|
});
|
|
}
|
|
|
|
if (!frozenAndMuted)
|
|
{
|
|
// allow you to additionally mute someone when they are already frozen
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze.
|
|
Text = Loc.GetString("admin-verbs-freeze-and-mute"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
_freeze.FreezeAndMute(args.Target);
|
|
},
|
|
Impact = LogImpact.Medium,
|
|
});
|
|
}
|
|
|
|
if (frozen)
|
|
{
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze.
|
|
Text = Loc.GetString("admin-verbs-unfreeze"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
RemComp<AdminFrozenComponent>(args.Target);
|
|
},
|
|
Impact = LogImpact.Medium,
|
|
});
|
|
}
|
|
|
|
|
|
// Admin Logs
|
|
if (_adminManager.HasAdminFlag(player, AdminFlags.Logs))
|
|
{
|
|
Verb logsVerbEntity = new()
|
|
{
|
|
Priority = -2,
|
|
Text = Loc.GetString("admin-verbs-admin-logs-entity"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () =>
|
|
{
|
|
var ui = new AdminLogsEui();
|
|
_euiManager.OpenEui(ui, player);
|
|
ui.SetLogFilter(search:args.Target.Id.ToString());
|
|
},
|
|
Impact = LogImpact.Low
|
|
};
|
|
args.Verbs.Add(logsVerbEntity);
|
|
}
|
|
|
|
// TeleportTo
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Text = Loc.GetString("admin-verbs-teleport-to"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/open.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
_console.ExecuteCommand(player, $"tpto {GetNetEntity(args.Target)}");
|
|
},
|
|
Impact = LogImpact.Low
|
|
});
|
|
|
|
// TeleportHere
|
|
args.Verbs.Add(new Verb
|
|
{
|
|
Text = Loc.GetString("admin-verbs-teleport-here"),
|
|
Category = VerbCategory.Admin,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/close.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
if (HasComp<MapGridComponent>(args.Target))
|
|
{
|
|
if (player.AttachedEntity != null)
|
|
{
|
|
var mapPos = _transformSystem.GetMapCoordinates(player.AttachedEntity.Value);
|
|
if (TryComp(args.Target, out PhysicsComponent? targetPhysics))
|
|
{
|
|
var offset = targetPhysics.LocalCenter;
|
|
var rotation = _transformSystem.GetWorldRotation(args.Target);
|
|
offset = rotation.RotateVec(offset);
|
|
|
|
mapPos = mapPos.Offset(-offset);
|
|
}
|
|
|
|
_console.ExecuteCommand(player, $"tpgrid {GetNetEntity(args.Target)} {mapPos.X} {mapPos.Y} {mapPos.MapId}");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
_console.ExecuteCommand(player, $"tpto {args.User} {args.Target}");
|
|
}
|
|
},
|
|
Impact = LogImpact.Low
|
|
});
|
|
|
|
// This logic is needed to be able to modify the AI's laws through its core and eye.
|
|
EntityUid? target = null;
|
|
SiliconLawBoundComponent? lawBoundComponent = null;
|
|
|
|
if (TryComp(args.Target, out lawBoundComponent))
|
|
{
|
|
target = args.Target;
|
|
}
|
|
// When inspecting the core we can find the entity with its laws by looking at the AiHolderComponent.
|
|
else if (TryComp<StationAiHolderComponent>(args.Target, out var holder) && holder.Slot.Item != null
|
|
&& TryComp(holder.Slot.Item, out lawBoundComponent))
|
|
{
|
|
target = holder.Slot.Item.Value;
|
|
// For the eye we can find the entity with its laws as the source of the movement relay since the eye
|
|
// is just a proxy for it to move around and look around the station.
|
|
}
|
|
else if (TryComp<MovementRelayTargetComponent>(args.Target, out var relay)
|
|
&& TryComp(relay.Source, out lawBoundComponent))
|
|
{
|
|
target = relay.Source;
|
|
|
|
}
|
|
|
|
if (lawBoundComponent != null && target != null)
|
|
{
|
|
args.Verbs.Add(new Verb()
|
|
{
|
|
Text = Loc.GetString("silicon-law-ui-verb"),
|
|
Category = VerbCategory.Admin,
|
|
Act = () =>
|
|
{
|
|
var ui = new SiliconLawEui(_siliconLawSystem, EntityManager, _adminManager);
|
|
if (!_playerManager.TryGetSessionByEntity(args.User, out var session))
|
|
{
|
|
return;
|
|
}
|
|
_euiManager.OpenEui(ui, session);
|
|
ui.UpdateLaws(lawBoundComponent, target.Value);
|
|
},
|
|
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Actions/actions_borg.rsi"), "state-laws"),
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
private void AddDebugVerbs(GetVerbsEvent<Verb> args)
|
|
{
|
|
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
|
return;
|
|
|
|
var player = actor.PlayerSession;
|
|
|
|
// Delete verb
|
|
if (_toolshed.ActivePermissionController?.CheckInvokable(new CommandSpec(_toolshed.DefaultEnvironment.GetCommand("delete"), null), player, out _) ?? false)
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("delete-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")),
|
|
Act = () => EntityManager.DeleteEntity(args.Target),
|
|
Impact = LogImpact.Medium,
|
|
ConfirmationPopup = true
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Rejuvenate verb
|
|
if (_toolshed.ActivePermissionController?.CheckInvokable(new CommandSpec(_toolshed.DefaultEnvironment.GetCommand("rejuvenate"), null), player, out _) ?? false)
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("rejuvenate-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png")),
|
|
Act = () => _rejuvenate.PerformRejuvenate(args.Target),
|
|
Impact = LogImpact.Medium
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Control mob verb
|
|
if (_toolshed.ActivePermissionController?.CheckInvokable(new CommandSpec(_toolshed.DefaultEnvironment.GetCommand("mind"), "control"), player, out _) ?? false &&
|
|
args.User != args.Target)
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("control-mob-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
// TODO VERB ICON control mob icon
|
|
Act = () =>
|
|
{
|
|
_mindSystem.ControlMob(args.User, args.Target);
|
|
},
|
|
Impact = LogImpact.High,
|
|
ConfirmationPopup = true
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// XenoArcheology
|
|
if (_adminManager.IsAdmin(player) && TryComp<ArtifactComponent>(args.Target, out var artifact))
|
|
{
|
|
// make artifact always active (by adding timer trigger)
|
|
args.Verbs.Add(new Verb()
|
|
{
|
|
Text = Loc.GetString("artifact-verb-make-always-active"),
|
|
Category = VerbCategory.Debug,
|
|
Act = () => EntityManager.AddComponent<ArtifactTimerTriggerComponent>(args.Target),
|
|
Disabled = EntityManager.HasComponent<ArtifactTimerTriggerComponent>(args.Target),
|
|
Impact = LogImpact.High
|
|
});
|
|
|
|
// force to activate artifact ignoring timeout
|
|
args.Verbs.Add(new Verb()
|
|
{
|
|
Text = Loc.GetString("artifact-verb-activate"),
|
|
Category = VerbCategory.Debug,
|
|
Act = () => _artifactSystem.ForceActivateArtifact(args.Target, component: artifact),
|
|
Impact = LogImpact.High
|
|
});
|
|
}
|
|
|
|
// Make Sentient verb
|
|
if (_groupController.CanCommand(player, "makesentient") &&
|
|
args.User != args.Target &&
|
|
!EntityManager.HasComponent<MindContainerComponent>(args.Target))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("make-sentient-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/sentient.svg.192dpi.png")),
|
|
Act = () => MakeSentientCommand.MakeSentient(args.Target, EntityManager),
|
|
Impact = LogImpact.Medium
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Set clothing verb
|
|
if (_groupController.CanCommand(player, "setoutfit") &&
|
|
EntityManager.HasComponent<InventoryComponent>(args.Target))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("set-outfit-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/outfit.svg.192dpi.png")),
|
|
Act = () => _euiManager.OpenEui(new SetOutfitEui(GetNetEntity(args.Target)), player),
|
|
Impact = LogImpact.Medium
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// In range unoccluded verb
|
|
if (_groupController.CanCommand(player, "inrangeunoccluded"))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("in-range-unoccluded-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
|
|
Act = () =>
|
|
{
|
|
|
|
var message = _examine.InRangeUnOccluded(args.User, args.Target)
|
|
? Loc.GetString("in-range-unoccluded-verb-on-activate-not-occluded")
|
|
: Loc.GetString("in-range-unoccluded-verb-on-activate-occluded");
|
|
|
|
_popup.PopupEntity(message, args.Target, args.User);
|
|
}
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Get Disposal tube direction verb
|
|
if (_groupController.CanCommand(player, "tubeconnections") &&
|
|
EntityManager.TryGetComponent(args.Target, out DisposalTubeComponent? tube))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("tube-direction-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
|
|
Act = () => _disposalTubes.PopupDirections(args.Target, tube, args.User)
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Make ghost role verb
|
|
if (_groupController.CanCommand(player, "makeghostrole") &&
|
|
!(EntityManager.GetComponentOrNull<MindContainerComponent>(args.Target)?.HasMind ?? false))
|
|
{
|
|
Verb verb = new();
|
|
verb.Text = Loc.GetString("make-ghost-role-verb-get-data-text");
|
|
verb.Category = VerbCategory.Debug;
|
|
// TODO VERB ICON add ghost icon
|
|
// Where is the national park service icon for haunted forests?
|
|
verb.Act = () => _ghostRoleSystem.OpenMakeGhostRoleEui(player, args.Target);
|
|
verb.Impact = LogImpact.Medium;
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
if (_groupController.CanAdminMenu(player) &&
|
|
EntityManager.TryGetComponent(args.Target, out ConfigurationComponent? config))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("configure-verb-get-data-text"),
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
|
|
Category = VerbCategory.Debug,
|
|
Act = () => _uiSystem.OpenUi(args.Target, ConfigurationUiKey.Key, actor.PlayerSession)
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
|
|
// Add verb to open Solution Editor
|
|
if (_groupController.CanCommand(player, "addreagent") &&
|
|
EntityManager.HasComponent<SolutionContainerManagerComponent>(args.Target))
|
|
{
|
|
Verb verb = new()
|
|
{
|
|
Text = Loc.GetString("edit-solutions-verb-get-data-text"),
|
|
Category = VerbCategory.Debug,
|
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/spill.svg.192dpi.png")),
|
|
Act = () => OpenEditSolutionsEui(player, args.Target),
|
|
Impact = LogImpact.Medium // maybe high depending on WHAT reagents they add...
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
}
|
|
|
|
#region SolutionsEui
|
|
private void OnSolutionChanged(Entity<SolutionContainerManagerComponent> entity, ref SolutionContainerChangedEvent args)
|
|
{
|
|
foreach (var list in _openSolutionUis.Values)
|
|
{
|
|
foreach (var eui in list)
|
|
{
|
|
if (eui.Target == entity.Owner)
|
|
eui.StateDirty();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void OpenEditSolutionsEui(ICommonSession session, EntityUid uid)
|
|
{
|
|
if (session.AttachedEntity == null)
|
|
return;
|
|
|
|
var eui = new EditSolutionsEui(uid);
|
|
_euiManager.OpenEui(eui, session);
|
|
eui.StateDirty();
|
|
|
|
if (!_openSolutionUis.ContainsKey(session)) {
|
|
_openSolutionUis[session] = new List<EditSolutionsEui>();
|
|
}
|
|
|
|
_openSolutionUis[session].Add(eui);
|
|
}
|
|
|
|
public void OnEditSolutionsEuiClosed(ICommonSession session, EditSolutionsEui eui)
|
|
{
|
|
_openSolutionUis[session].Remove(eui);
|
|
if (_openSolutionUis[session].Count == 0)
|
|
_openSolutionUis.Remove(session);
|
|
}
|
|
|
|
private void Reset(RoundRestartCleanupEvent ev)
|
|
{
|
|
foreach (var euis in _openSolutionUis.Values)
|
|
{
|
|
foreach (var eui in euis.ToList())
|
|
{
|
|
eui.Close();
|
|
}
|
|
}
|
|
_openSolutionUis.Clear();
|
|
}
|
|
#endregion
|
|
}
|
|
}
|