Files
wwdpublic/Content.Shared/_Goobstation/Enchanting/Systems/EnchantSacrificeSystem.cs
Kai5 ae1c1c39dd Port Devil (#2454)
<!--
This is a semi-strict format, you can add/remove sections as needed but
the order/format should be kept the same
Remove these comments before submitting
-->

<!--
Explain this PR in as much detail as applicable

Some example prompts to consider:
How might this affect the game? The codebase?
What might be some alternatives to this?
How/Who does this benefit/hurt [the game/codebase]?
-->

This PR ports
https://github.com/Goob-Station/Goob-Station/pull/2409
https://github.com/Goob-Station/Goob-Station/pull/2591
https://github.com/Goob-Station/Goob-Station/pull/2599

This PR was initially intended to be merged into White Dream repo, so my
changes are marked as WD edit.

<!--
A list of everything you have to do before this PR is "complete"
You probably won't have to complete everything before merging but it's
good to leave future references
-->

- [ ] Port pain numbness
- [ ] Port nullrods
- [ ] Port tile movement

---

<!--
This is default collapsed, readers click to expand it and see all your
media
The PR media section can get very large at times, so this is a good way
to keep it clean
The title is written using HTML tags
The title must be within the <summary> tags or you won't see it
-->

<details><summary><h1>Media</h1></summary>
<p>

![image](https://github.com/user-attachments/assets/ee4679d1-fc07-4dc3-8063-e0220bc0d728)

![image](https://github.com/user-attachments/assets/25f590b9-6bf3-43bd-aca3-80452f27b0dd)

![image](https://github.com/user-attachments/assets/1ffb5bb3-e0c7-4827-8193-83bd8480e555)

![image](https://github.com/user-attachments/assets/4ed8c762-1e51-4bd8-9800-6495c12ac68f)

</p>
</details>

---

<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->

🆑
- add: Ported Devil antag from Goobstation

---------

Signed-off-by: Kai5 <68296202+Kai518@users.noreply.github.com>
Signed-off-by: VMSolidus <evilexecutive@gmail.com>
Co-authored-by: Solstice <solsticeofthewinter@gmail.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2025-07-20 13:37:35 +10:00

81 lines
2.9 KiB
C#

// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
// SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
using Content.Shared._Goobstation.Devil.Condemned;
using Content.Shared.IdentityManagement;
using Content.Shared.Mind;
using Content.Shared.Mobs;
using Content.Shared.Popups;
namespace Content.Shared._Goobstation.Enchanting.Systems;
/// <summary>
/// Handles upgrading enchanted item tier when a player-controlled mob is sacrificed on top of an altar with it.
/// </summary>
public sealed class EnchantSacrificeSystem : EntitySystem
{
// [Dependency] private readonly EnchantingSystem _enchanting = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
private EntityQuery<CondemnedComponent> _condemnedQuery;
// public override void Initialize()
// {
// base.Initialize();
//
// _condemnedQuery = GetEntityQuery<CondemnedComponent>();
//
// SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
// }
// private void OnMobStateChanged(MobStateChangedEvent args)
// {
// // only care about mobs going from alive/crit to dead
// if (args.NewMobState != MobState.Dead)
// return;
//
// // only care about player-controlled mobs, even if they're mice and shit
// var mob = args.Target;
// if (!_mind.TryGetMind(mob, out var mind, out _))
// return;
//
// // don't double dip by killing and reviving someone
// if (_condemnedQuery.HasComp(mob) || _condemnedQuery.HasComp(mind))
// return;
//
// // // only care if the mob dies on an enchanting table
// // if (_enchanting.FindTable(mob) is not {} table)
// // return;
// //
// // var items = _enchanting.FindEnchantedItems(table);
// // var upgraded = 0;
// // EntityUid? anyItem = null;
// // foreach (var item in items)
// // {
// // if (_enchanting.TryUpgradeTier(item))
// // {
// // upgraded++;
// // anyItem = item;
// // }
// // }
//
// // nothing was upgraded L
// if (upgraded == 0 || anyItem is not {} any)
// return;
//
// // no double dipping
// EnsureComp<CondemnedComponent>(mob);
// EnsureComp<CondemnedComponent>(mind);
//
// var identity = Identity.Name(mob, EntityManager);
// var msg = upgraded == 1
// ? Loc.GetString("enchanting-sacrifice-single", ("target", identity), ("item", any))
// : Loc.GetString("enchanting-sacrifice-multiple", ("target", identity));
//
// _popup.PopupPredicted(msg, mob, null, PopupType.LargeCaution);
// }
}