* mech system, fix hands, fix fraction * fix * fix fake hypo * fix triple airlocks big sizing * fix * upd clown hulk * xd fix 2 * bigger exit delay * mechs reflect changes * guns changes * draike up * mechs in another category * add equipment * Revert "upd clown hulk" This reverts commit b8084967040be5d442b2d4770cf7fdece1daa2a8. * SPIN MY MECH ASS * mech no rot * some resprite * no injections in hardsuits * some species can not be injectable * medipans can ignore armor, admeme hypospray ignore armor * fix * fix admeme hypo * mob fraction fix * rover + nt gygax add * fix description * fix id * some better dome effects * если пустая гильза в стволе -> Кнопки "казнь" не будет * phazon added * fix server crashes * full rework mechs on mobstates, coils fix mechs, diagnostic hud show health bar for mechs, mechs fastest repair, add mech analyzer * some fixes * configure health of all mechs * upd * add rover to uplink * translate bundle * change price * phazon construction * fix * fix * Finish phazon construction * add phazon research and recipes * phazon construction translate * fix * Mech lights * fix * translate light action * Mech sounds, fix damage * fix * fix hello sound * upd * fix linter * change damagePercentage * fix * fix hello sound * temp disable damage sounds * fix battery needed on construct * some changes * add mech painting system as DEBUG(in dev) * Fix yaml, durand paintings * mech spray cans textures * change sprite * fix * ripley, clarke new textures * ripley,clarke paints * fix * sec pod texture --------- Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
92 lines
3.2 KiB
C#
92 lines
3.2 KiB
C#
using Content.Server.Chemistry.Containers.EntitySystems;
|
|
using Content.Shared._Sunrise.Paint;
|
|
using Content.Shared.DoAfter;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Interaction;
|
|
using Content.Shared.Inventory;
|
|
using Content.Shared.Nutrition.EntitySystems;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Sprite;
|
|
using Content.Shared.SubFloor;
|
|
using Content.Shared.Verbs;
|
|
using Content.Shared.Mech.Components;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Robust.Shared.Utility;
|
|
using PaintComponent = Content.Shared._Sunrise.Paint.PaintComponent;
|
|
using PaintDoAfterEvent = Content.Shared._Sunrise.Paint.PaintDoAfterEvent;
|
|
using PaintedComponent = Content.Shared._Sunrise.Paint.PaintedComponent;
|
|
|
|
namespace Content.Server._Sunrise.Paint;
|
|
|
|
/// <summary>
|
|
/// Colors target and consumes reagent on each color success.
|
|
/// </summary>
|
|
public sealed class MechPaintSystem : SharedMechPaintSystem
|
|
{
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
|
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
|
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
|
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
|
[Dependency] private readonly InventorySystem _inventory = default!;
|
|
[Dependency] private readonly OpenableSystem _openable = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<MechPaintComponent, AfterInteractEvent>(OnInteract);
|
|
SubscribeLocalEvent<MechPaintComponent, GetVerbsEvent<UtilityVerb>>(OnPaintVerb);
|
|
}
|
|
|
|
private void OnInteract(EntityUid uid, MechPaintComponent component, AfterInteractEvent args)
|
|
{
|
|
if (!args.CanReach)
|
|
return;
|
|
|
|
if (args.Target is not { Valid: true } target)
|
|
return;
|
|
|
|
if (!HasComp<MechComponent>(args.Target))
|
|
return;
|
|
|
|
PrepPaint(uid, component, target, args.User);
|
|
}
|
|
|
|
private void OnPaintVerb(EntityUid uid, MechPaintComponent component, GetVerbsEvent<UtilityVerb> args)
|
|
{
|
|
if (!args.CanInteract || !args.CanAccess)
|
|
return;
|
|
|
|
if (!HasComp<MechComponent>(args.Target))
|
|
return;
|
|
|
|
var paintText = Loc.GetString("paint-verb");
|
|
|
|
var verb = new UtilityVerb()
|
|
{
|
|
Act = () =>
|
|
{
|
|
PrepPaint(uid, component, args.Target, args.User);
|
|
},
|
|
|
|
Text = paintText,
|
|
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/paint.svg.192dpi.png"))
|
|
};
|
|
args.Verbs.Add(verb);
|
|
}
|
|
private void PrepPaint(EntityUid uid, MechPaintComponent component, EntityUid target, EntityUid user)
|
|
{
|
|
|
|
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, component.Delay, new PaintDoAfterEvent(), uid, target: target, used: uid)
|
|
{
|
|
BreakOnMove = true,
|
|
BreakOnDamage = true,
|
|
NeedHand = true,
|
|
BreakOnHandChange = true
|
|
};
|
|
|
|
if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs))
|
|
return;
|
|
}
|
|
}
|