mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* Nubody (#42419) * Nubody * fix test fails * gibbing * lung test returns * doc comment * hand organ test * giblet test * yaml formatting * returning * relocate * trimming * re-smite * oops thusd tweak * arachnids have slower metabolism i guess * never mind the old behaviour is bad actually * rider whyyy * style changes and allat * fix collision --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * C# files done * Visual nubody (humanoid appearance refactor) (#42476) * initial visual nubody * oops overlay * im so pheeming rn * conversion... * tests * comeback of the underwear * oops eyes * blabbl * zeds * yaml linted * search and visible count constraints * reordering * preserve previously selected markings colors * fix test * some ui niceties * ordering * make DB changes backwards-compatible/downgrade-friendly * fix things again * fix migration * vulpkanin markings limit increase * wrapping * code cleanup and more code cleanup and more code cleanup and more code cleanup and * fix slop ports * better sampling API * make filter work + use the method i made for its intended purpose * fix test fails real quick * magic mirror cleanup, remove TODO * don't 0-init the organ profile data * remove deltastates --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Let vox eat trash again (#42503) * C# complete port * Getting closer * Harpy Nubody Port * Port Feroxi, Kitsune. Fix some yml typos and remove ipcs stuff * Port Oni * Port Rest, except Motorkind * Port Motorkind * Remove more surgery, restore too much deleted stuff * Fix Typos and change some organ names. Need to split eyes next * Harpy HAve Wings again * Some fixes, More Surgeyr Removal, Copying of eye organs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use correct Body imports * Markings Refactoring, Harpy Layering * Motorkind doesn't crash anymore. Some layer remappings. * Allow Organs to have Markings Displacements again. (#43604) * first shtep * readd markings support --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Fix STalk eyes and several layerings * Fix sexed organs (#42554) * Fix markings for several species, fit them for sexed organs and rename some files to fit them for it * Additional IPC-related removals * Vulpkanin eyes are now correct again * Fix Subtle Cultist Marks on species * Fix Asakim Sprites (sexed) and make CD imports work * Migration, error fixes, and Height * Fix humanoid profile voice being broken (#42550) Fix humanoid appearance voice being broken * Change Kitsune SexChanged Event to with ref * Fix asakim issue, Respirator fix * Simplify hands UI code (#42534) * Simplify hands UI code * i remembered about SortedHands in the component * minor cleanup --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Set size of Analyzer back to 350, Kitsune can't gib themselves no more. Migration * yml linter errors and an rudimentary onAdd Organ Functionality * Fixing it trying to remove nothing * midpoint migration * Why do you put so many organs everywhere * More missing prototypes * Migration of more organs * Forgot lungs * Move character preview handling into a specialized control (#41252) * Move character preview handling into a specialized control Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> * Restore job name that I accidentally removed from character picker buttons * Just resolve dependencies the standard way --------- Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> Co-authored-by: Janet Blackquill <uhhadd@gmail.com> * Drop ICharacterProfile/ICharacterAppearance interfaces (#42661) * Ensure profile loading only returns valid species (#42842) (Stable merge) (#42865) Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> * Changes to make it work for us. * No more bald Harpy * OperatingTables instead of null * Adding Delta V Comments, commenting out instead of deleting * Fix broken Height Scale. * Remove HumanoidSilicon Mention * Did an error. Readded, uncommented. * Clean up Marking data structure, add tests for Zombie transformation (#42756) * Clean up Marking data structure, add tests for Zombie transformation * empty * AAAAAAAAAAAAAAAA --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Fix markings colour setting (#42771) * Fix: Markings Color For Downstream * Comment out A Leg. Remove Todo * Revert to original hidden species code --------- Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Co-authored-by: Absotively <jen@jenpollock.ca> Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> Co-authored-by: Myra <vasilis@pikachu.systems>
120 lines
4.5 KiB
C#
120 lines
4.5 KiB
C#
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
|
|
// SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using Content.Shared._Goobstation.CheatDeath;
|
|
using Content.Shared._Goobstation.Devil;
|
|
using Content.Shared._Goobstation.Devil.Condemned;
|
|
using Content.Shared.Mobs.Components;
|
|
using Content.Shared.Verbs;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Server._Goobstation.Devil;
|
|
|
|
public sealed partial class DevilSystem
|
|
{
|
|
private void InitializeHandshakeSystem()
|
|
{
|
|
SubscribeLocalEvent<DevilComponent, GetVerbsEvent<InnateVerb>>(OnGetVerbs);
|
|
SubscribeLocalEvent<PendingHandshakeComponent, GetVerbsEvent<InnateVerb>>(OnGetVerbsPending);
|
|
}
|
|
|
|
private void OnGetVerbs(EntityUid uid, DevilComponent comp, GetVerbsEvent<InnateVerb> args)
|
|
{
|
|
// Can't shake your own hand, and you can't shake from a distance
|
|
if (!args.CanAccess
|
|
|| !args.CanInteract
|
|
|| _state.IsIncapacitated(args.Target)
|
|
|| !HasComp<MobStateComponent>(args.Target)
|
|
|| HasComp<CondemnedComponent>(args.Target)
|
|
|| args.Target == args.User
|
|
|| _hands.GetHandCount(uid) == 0 // Delta V - Nubody Replacement, just count hands
|
|
|| _hands.GetHandCount(args.Target) == 0 // Delta V - Nubody Replacement, just count hands
|
|
|| !_contract.IsUserValid(args.Target, out _))
|
|
return;
|
|
|
|
InnateVerb handshakeVerb = new()
|
|
{
|
|
Act = () => OfferHandshake(args.User, args.Target),
|
|
Text = Loc.GetString("hand-shake-prompt-verb", ("target", args.Target)),
|
|
Icon = new SpriteSpecifier.Rsi(new("_Goobstation/Actions/devil.rsi"), "summon-contract"),
|
|
Priority = 1 // Higher priority than default verbs
|
|
};
|
|
args.Verbs.Add(handshakeVerb);
|
|
}
|
|
|
|
private void OnGetVerbsPending(EntityUid uid, PendingHandshakeComponent comp, GetVerbsEvent<InnateVerb> args)
|
|
{
|
|
if (!args.CanAccess
|
|
|| !args.CanInteract
|
|
|| _state.IsIncapacitated(args.Target)
|
|
|| !HasComp<MobStateComponent>(args.Target)
|
|
|| args.Target != comp.Offerer)
|
|
return;
|
|
|
|
InnateVerb handshakeVerb = new()
|
|
{
|
|
Act = () => HandleHandshake(args.Target, args.User),
|
|
Text = Loc.GetString("hand-shake-accept-verb", ("target", args.Target)),
|
|
Icon = new SpriteSpecifier.Rsi(new("_Goobstation/Actions/devil.rsi"), "summon-contract"),
|
|
Priority = 1 // Higher priority than default verbs
|
|
};
|
|
args.Verbs.Add(handshakeVerb);
|
|
}
|
|
|
|
private void OfferHandshake(EntityUid user, EntityUid target)
|
|
{
|
|
if (HasComp<DevilComponent>(target)
|
|
|| HasComp<PendingHandshakeComponent>(target)
|
|
|| !_contract.IsUserValid(target, out _))
|
|
return;
|
|
|
|
var pending = AddComp<PendingHandshakeComponent>(target);
|
|
pending.Offerer = user;
|
|
pending.ExpiryTime = _timing.CurTime + TimeSpan.FromSeconds(15);
|
|
|
|
// Notify target
|
|
var popupMessage = Loc.GetString("handshake-offer-popup", ("user", user));
|
|
_popup.PopupEntity(popupMessage, target, target);
|
|
|
|
// Notify self
|
|
var selfPopup = Loc.GetString("handshake-offer-popup-self", ("target", target));
|
|
_popup.PopupEntity(selfPopup, user, user);
|
|
}
|
|
private void HandleHandshake(EntityUid user, EntityUid target)
|
|
{
|
|
if (!_contract.TryTransferSouls(user, target, 1))
|
|
{
|
|
var handshakeFail = Loc.GetString("handshake-fail", ("user", user));
|
|
_popup.PopupEntity(handshakeFail, user, user);
|
|
return;
|
|
}
|
|
|
|
var handshakeSucess = Loc.GetString("handshake-success", ("user", user));
|
|
_popup.PopupEntity(handshakeSucess, target, target);
|
|
_rejuvenate.PerformRejuvenate(target);
|
|
|
|
var cheatdeath = EnsureComp<CheatDeathComponent>(target);
|
|
cheatdeath.ReviveAmount = 1;
|
|
|
|
_contract.AddRandomNegativeClause(target);
|
|
}
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
var query = EntityQueryEnumerator<PendingHandshakeComponent>();
|
|
while (query.MoveNext(out var uid, out var comp))
|
|
{
|
|
if (comp.ExpiryTime > _timing.CurTime)
|
|
continue;
|
|
|
|
RemCompDeferred(uid, comp);
|
|
}
|
|
}
|
|
}
|