ГНОМЫ (#411)
* This adds the basic wirework for the gnomes, very unfinished * GNOMES ARE DONE EXCEPT FOR GLUE WOOO * removes gnome id, fixes ai and punch sounds, comments out the code for glue to take fuel * changed sounds to non meme versions * HAT NOW GIVES THE GNOME ACCENT TOO * fixes a typo with Unclippable being Unclipable * removed cuffable component (iforgotaboutit) * added unrevivable to gnomes so defibs wont try (it was immpossible anyways but this is better) * removes scrap code i put in the repair system * remove the carrot mutation code i made (its bad) clean up some things in the repairable system * changes accent system from rplacging g to replacing no * Fix the conflict (plz work) * adds another comment bleh bleh im trying to fix things * PAIN.jpeg * work plz? * FIX FOR REAL * camel case mayhaps? * adds unfinished glue use code (you can still see lit or not lit when held >:/ ) * temporary fix * add: GNOMES REVAMPED * fix: fix accent, sounds and add spawners * add: gnome seeds to seed vendor --------- Co-authored-by: BITTERLYNX <gagestemmerman@gmail.com>
This commit is contained in:
@@ -6,15 +6,37 @@ using Content.Shared.Popups;
|
||||
using Content.Shared.Repairable;
|
||||
using Content.Shared.Tools;
|
||||
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.EUI;
|
||||
using Content.Server.Ghost;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Components;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Content.Server.Construction.Conditions;
|
||||
//many of these arent reqired but some seem neessesary so ill leave them for now
|
||||
|
||||
namespace Content.Server.Repairable
|
||||
{
|
||||
public sealed class RepairableSystem : SharedRepairableSystem
|
||||
{
|
||||
[Dependency] private readonly EuiManager _euiManager = default!;
|
||||
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly MobThresholdSystem _mobThreshold = default!;
|
||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -24,6 +46,8 @@ namespace Content.Server.Repairable
|
||||
|
||||
private void OnRepairFinished(EntityUid uid, RepairableComponent component, RepairFinishedEvent args)
|
||||
{
|
||||
ICommonSession? session = null;
|
||||
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
@@ -34,15 +58,36 @@ namespace Content.Server.Repairable
|
||||
{
|
||||
var damageChanged = _damageableSystem.TryChangeDamage(uid, component.Damage, true, false, origin: args.User);
|
||||
_adminLogger.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} by {damageChanged?.GetTotal()}");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Repair all damage
|
||||
_damageableSystem.SetAllDamage(uid, damageable, 0);
|
||||
_adminLogger.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} back to full health");
|
||||
}
|
||||
|
||||
// this is to revive gnomes and call their ghost back
|
||||
//check for target for threshholds, i hardly understand WHY this works but it does so i wont touch it
|
||||
if (TryComp(uid, out MobThresholdsComponent? mobthresholds))
|
||||
{
|
||||
if (_mobThreshold.TryGetThresholdForState(uid, MobState.Dead, out var threshold) &&
|
||||
TryComp<DamageableComponent>(uid, out var damageableComponent) &&
|
||||
damageableComponent.TotalDamage < threshold)
|
||||
{
|
||||
_mobState.ChangeMobState(uid, MobState.Alive, null, uid);
|
||||
}
|
||||
if (_mind.TryGetMind(uid, out _, out var mind) &&
|
||||
mind.Session is { } playerSession)
|
||||
{
|
||||
session = playerSession;
|
||||
// notify them they're being revived.
|
||||
if (mind.CurrentEntity != uid)
|
||||
{
|
||||
_euiManager.OpenEui(new ReturnToBodyEui(mind, _mind), session);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
var str = Loc.GetString("comp-repairable-repair",
|
||||
("target", uid),
|
||||
("tool", args.Used!));
|
||||
|
||||
Reference in New Issue
Block a user