-
Notifications
You must be signed in to change notification settings - Fork 125
Чудо-Юдо. Новый монстр Недр. H/M #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
f654429
77461fc
2eb612c
bad4104
e0a7854
95ff07c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| using Robust.Shared.Map; | ||
| using Robust.Shared.Audio; | ||
| using Content.Shared.Chat.Prototypes; | ||
| using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
| using Content.Shared.Damage; | ||
| using Robust.Shared.Prototypes; | ||
| using Content.Shared.FixedPoint; | ||
| using Content.Shared.Mobs.Systems; | ||
| namespace Content.Server.Imperial.SCP.NothingThere.Components; | ||
|
|
||
| [RegisterComponent] | ||
| public sealed partial class ImperialControlledNothingThereComponent : Component | ||
| { | ||
| [DataField("gibBodyAction")] | ||
| public EntProtoId GibBodyAction = "ImperialNothingThereGibBodyAction"; | ||
| [ViewVariables] | ||
| public EntityUid? GibBodyEntity; | ||
| [ViewVariables] | ||
| public EntityUid OriginalBody = EntityUid.Invalid; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавьте либо атрибут ViewVariables, либо DataField |
||
| [ViewVariables] | ||
| public SoundSpecifier ExitSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_gibbody.ogg"); | ||
| [ViewVariables] | ||
| public int KillCount = 0; | ||
|
Comment on lines
+19
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Не храните runtime-состояние как prototype-конфиг. По текущему использованию Based on learnings: In the Imperial SS14 project, fields of components that are not configured via YAML prototypes (runtime state) should be marked with the [ViewVariables] attribute, while fields configured via prototypes should use [DataField]. 🤖 Prompt for AI Agents |
||
| [ViewVariables] | ||
| public SoundSpecifier GibSound = new SoundCollectionSpecifier("gib", AudioParams.Default.WithVariation(0.025f)); | ||
| [ViewVariables] | ||
| public float GibletLaunchImpulse = 150; | ||
| [ViewVariables] | ||
| public float GibletLaunchImpulseVariance = 3; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||||
| using Robust.Shared.Map; | ||||||
| using Robust.Shared.Audio; | ||||||
| using Content.Shared.Chat.Prototypes; | ||||||
| using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||||||
| using Content.Shared.Damage; | ||||||
| using Robust.Shared.Prototypes; | ||||||
| using Content.Shared.FixedPoint; | ||||||
| using Content.Shared.Mobs.Systems; | ||||||
| using Content.Shared.Mobs; | ||||||
|
Comment on lines
+8
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Неиспользуемые директивы
♻️ Предлагаемое исправление-using Content.Shared.Mobs.Systems;
-using Content.Shared.Mobs;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; | ||||||
| using Content.Shared.Damage.Prototypes; | ||||||
| using Content.Shared.Polymorph; | ||||||
| namespace Content.Server.Imperial.SCP.NothingThere.Components; | ||||||
|
|
||||||
| [RegisterComponent] | ||||||
| public sealed partial class ImperialNothingThereComponent : Component | ||||||
| { | ||||||
| public SoundSpecifier ChaseSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_idle.ogg"); | ||||||
|
|
||||||
| [ViewVariables] | ||||||
| public EntityUid? PlayingStream; | ||||||
|
|
||||||
| [ViewVariables] | ||||||
| public bool IsPlaying = false; | ||||||
| [DataField("enterBodyAction")] | ||||||
| public EntProtoId EnterBodyAction = "ImperialNothingThereEnterBodyAction"; | ||||||
| public EntityUid? EnterBodyEntity; | ||||||
|
|
||||||
| [DataField] | ||||||
| public TimeSpan EnterBodyWindUp = TimeSpan.FromSeconds(2); | ||||||
| [DataField("threshold", required: true)] | ||||||
| public FixedPoint2 Threshold = new(); | ||||||
| [DataField("killsRequired")] | ||||||
| public int KillsRequired = 5; | ||||||
|
|
||||||
| [DataField("killCount")] | ||||||
| public int KillCount = 0; | ||||||
|
|
||||||
| [DataField("phase")] | ||||||
| public NothingTherePhase Phase = NothingTherePhase.Original; | ||||||
| public EntProtoId? EggEntityProto = "ImperialSCPNothingThereEgg"; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Отсутствуют атрибуты Поля Based on learnings: "fields configured via prototypes should use [DataField]". ♻️ Предлагаемое исправление-public EntProtoId? EggEntityProto = "ImperialSCPNothingThereEgg";
+[DataField("eggEntityProto")]
+public EntProtoId? EggEntityProto = "ImperialSCPNothingThereEgg";-public EntProtoId? TrueEntityProto = "ImperialSCPNothingThereTrue";
+[DataField("trueEntityProto")]
+public EntProtoId? TrueEntityProto = "ImperialSCPNothingThereTrue";-public EntProtoId GoodbyeProto = "ImperialNothingThereEmpowerHit";
+[DataField("goodbyeProto")]
+public EntProtoId GoodbyeProto = "ImperialNothingThereEmpowerHit";-public EntProtoId HitProto = "ImperialNothingThereHit";
+[DataField("hitProto")]
+public EntProtoId HitProto = "ImperialNothingThereHit";Also applies to: 55-55, 74-75 🤖 Prompt for AI Agents |
||||||
| [DataField("transformEggAction")] | ||||||
| public EntProtoId TransformEggAction = "ImperialNothingThereEggAction"; | ||||||
| [DataField("transformEggEntity")] | ||||||
| public EntityUid? TransformEggEntity; | ||||||
| [DataField("enterSound")] | ||||||
| public SoundSpecifier EnterSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_enter.ogg"); | ||||||
|
|
||||||
| [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] | ||||||
| public TimeSpan EggTransformDuration = TimeSpan.FromSeconds(30); | ||||||
| [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] | ||||||
| public TimeSpan EggTransformEnd = TimeSpan.Zero; | ||||||
| [ViewVariables] | ||||||
| public EntProtoId? TrueEntityProto = "ImperialSCPNothingThereTrue"; | ||||||
| [DataField("hatchSound")] | ||||||
| public SoundSpecifier HatchSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_hatch.ogg"); | ||||||
| [ViewVariables] | ||||||
| public bool Empowered = false; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Отсутствуют атрибуты Поля Based on learnings: "fields of components that are not configured via YAML prototypes (runtime state) should be marked with the [ViewVariables] attribute". ♻️ Предлагаемое исправление-public bool Empowered = false;
+[ViewVariables]
+public bool Empowered = false;-public bool NeedGoodbye = false;
+[ViewVariables]
+public bool NeedGoodbye = false;Also applies to: 78-78 🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавьте либо атрибут ViewVariables, либо DataField
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: Length of output: 84 🏁 Script executed: Length of output: 5538
С учётом ранее зафиксированного правила проекта (runtime поля помечаем [ViewVariables]), предлагаю добавить [ViewVariables] к обоим полям. Минимальное исправление: отметить runtime‑поля [ViewVariables]. Если хотите сделать их настраиваемыми из YAML, скажите — заменю на [DataField("empowered")] и [DataField("needGoodbye")] (или добавлю их вдобавок к [ViewVariables], как уже сделано для EmpowerDamage). 🧠 Learnings usedFailed to handle agent chat message. Please try again. |
||||||
| [DataField("empowerAction")] | ||||||
| public EntProtoId EmpowerAction = "ImperialNothingThereHelloAction"; | ||||||
| [DataField("empowerEntity")] | ||||||
| public EntityUid? EmpowerEntity; | ||||||
| [DataField("empowerSound")] | ||||||
| public SoundSpecifier EmpowerSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_empower.ogg"); | ||||||
| [DataField(required: true), ViewVariables] | ||||||
| public DamageSpecifier EmpowerDamage = new(); | ||||||
| [ViewVariables] | ||||||
| public ProtoId<PolymorphPrototype> EggMorph = "NothingThereEggMorph"; | ||||||
| [ViewVariables] | ||||||
| public ProtoId<PolymorphPrototype> TrueMorph = "NothingThereTrueMorph"; | ||||||
| [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] | ||||||
| [ViewVariables] | ||||||
| public TimeSpan GoodbyeDelay = TimeSpan.FromSeconds(0.5f); | ||||||
| [ViewVariables] | ||||||
| public EntProtoId GoodbyeProto = "ImperialNothingThereEmpowerHit"; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Помечайте поля, которые вы не используете как датафилды, атрибутом ViewVariables |
||||||
| [ViewVariables] | ||||||
| public EntProtoId HitProto = "ImperialNothingThereHit"; | ||||||
| [DataField] | ||||||
| public bool NeedItems = false; | ||||||
| [ViewVariables] | ||||||
| public bool NeedGoodbye = false; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавьте либо атрибут ViewVariables, либо DataField |
||||||
| [DataField("projectileAction")] | ||||||
| public EntProtoId ProjectileAction = "ImperialNothingThereProjectileAction"; | ||||||
| [DataField("projectileEntity")] | ||||||
| public EntityUid? ProjectileEntity; | ||||||
| } | ||||||
|
|
||||||
| public enum NothingTherePhase : byte | ||||||
| { | ||||||
| Original = 0, | ||||||
| Egg = 1, | ||||||
| True = 2 | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using Robust.Shared.Prototypes; | ||
| using Robust.Shared.Audio; | ||
| using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; | ||
| [RegisterComponent] | ||
| public sealed partial class ImperialNothingThereGoodbyeComponent : Component | ||
| { | ||
| [ViewVariables] | ||
| public bool Used = false; | ||
| [ViewVariables] | ||
| public EntProtoId HitProto = "ImperialNothingThereHit"; | ||
| [DataField("empowerSound")] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Передача строки излишне |
||
| public SoundSpecifier EmpowerSound = new SoundPathSpecifier("/Audio/Imperial/SCP/nothingthere_empower.ogg"); | ||
| [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] | ||
| public TimeSpan AttackDuration = TimeSpan.FromSeconds(1.5); | ||
| [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] | ||
| public TimeSpan AttackEnd = TimeSpan.Zero; | ||
| [ViewVariables] | ||
| public EntityUid WeaponUser = EntityUid.Invalid; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||||||||||||||||||||||||||||||||
| using Content.Server.Imperial.SCP.NothingThere.Components; | ||||||||||||||||||||||||||||||||||||
| using Robust.Shared.Audio; | ||||||||||||||||||||||||||||||||||||
| using Content.Shared.Mobs; | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| namespace Content.Server.Imperial.SCP.NothingThere.Systems; | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| public sealed partial class ImperialNothingThereSystem | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| private void InitializeChaseMusic() | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| SubscribeLocalEvent<ImperialNothingThereComponent, MapInitEvent>(OnInit); | ||||||||||||||||||||||||||||||||||||
| SubscribeLocalEvent<ImperialNothingThereComponent, ComponentRemove>(OnRemove); | ||||||||||||||||||||||||||||||||||||
| SubscribeLocalEvent<ImperialNothingThereComponent, MobStateChangedEvent>(OnMobStateChanged); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| private void OnRemove(EntityUid uid, ImperialNothingThereComponent comp, ComponentRemove args) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| StopChaseMusic(uid, comp); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| public void StartChaseMusic(EntityUid uid, ImperialNothingThereComponent comp) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| if (comp.IsPlaying) | ||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||
| if (comp.Phase == NothingTherePhase.True) | ||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||
| comp.PlayingStream = _audio.PlayPvs( | ||||||||||||||||||||||||||||||||||||
| comp.ChaseSound, | ||||||||||||||||||||||||||||||||||||
| uid, | ||||||||||||||||||||||||||||||||||||
| AudioParams.Default.WithLoop(true) | ||||||||||||||||||||||||||||||||||||
| )?.Entity; | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| comp.IsPlaying = true; | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+27
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Если 💡 Возможный фикс- comp.PlayingStream = _audio.PlayPvs(
+ var stream = _audio.PlayPvs(
comp.ChaseSound,
uid,
AudioParams.Default.WithLoop(true)
)?.Entity;
-
- comp.IsPlaying = true;
+ if (stream == null)
+ return;
+
+ comp.PlayingStream = stream;
+ comp.IsPlaying = true;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| public void StopChaseMusic(EntityUid uid, ImperialNothingThereComponent comp) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| if (!comp.IsPlaying) | ||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||
| if (comp.Phase == NothingTherePhase.True) | ||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||
| if (comp.PlayingStream != null) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| _audio.Stop(comp.PlayingStream.Value); | ||||||||||||||||||||||||||||||||||||
| comp.PlayingStream = null; | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| comp.IsPlaying = false; | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| private void OnMobStateChanged(EntityUid uid, ImperialNothingThereComponent comp, MobStateChangedEvent args) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| if (_mobStateSystem.IsDead(uid) || _mobStateSystem.IsCritical(uid)) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| StopChaseMusic(uid, comp); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| else if (_mobStateSystem.IsAlive(uid)) | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| StartChaseMusic(uid, comp); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
|
|
||
| using Content.Server.Imperial.SCP.NothingThere.Components; | ||
| using Content.Shared.Imperial.SCP.NothingThere.Events; | ||
| using Content.Shared.Weapons.Melee.Events; | ||
| using Content.Shared.Hands.Components; | ||
| using Content.Shared.Popups; | ||
| using Content.Shared.DoAfter; | ||
| using Content.Shared.Mobs.Components; | ||
| using Robust.Shared.Timing; | ||
| namespace Content.Server.Imperial.SCP.NothingThere.Systems; | ||
|
|
||
| public sealed partial class ImperialNothingThereSystem | ||
| { | ||
| #region Initialize | ||
| private void InitializeArsenal() | ||
| { | ||
| SubscribeLocalEvent<ImperialNothingThereComponent, ImperialNothingThereGoodbyeEvent>(OnGoodbyeAction); | ||
| SubscribeLocalEvent<ImperialNothingThereComponent, ImperialNothingThereGoodbyeDoAfterEvent>(OnGoodbyeDoAfter); | ||
| SubscribeLocalEvent<ImperialNothingThereGoodbyeComponent, MeleeHitEvent>(OnGoodbyeAttack); | ||
| } | ||
| #endregion | ||
| #region Item provision | ||
| private void UpdateItemProvide() | ||
| { | ||
| var query = EntityQueryEnumerator<ImperialNothingThereComponent>(); | ||
| while (query.MoveNext(out var uid, out var comp)) | ||
| { | ||
| if (!comp.NeedItems) | ||
| continue; | ||
| var hands = EnsureComp<HandsComponent>(uid); | ||
| if (_hands.TryGetEmptyHand((uid, hands), out var emptyHand)) | ||
| { | ||
| EntityUid? hit; | ||
| if (comp.NeedGoodbye) | ||
| { | ||
| hit = Spawn(comp.GoodbyeProto, Transform(uid).Coordinates); | ||
| comp.NeedGoodbye = false; | ||
| } | ||
| else | ||
| { | ||
| hit = Spawn(comp.HitProto, Transform(uid).Coordinates); | ||
| } | ||
| if (!_hands.TryForcePickup(uid, hit ?? EntityUid.Invalid, emptyHand, checkActionBlocker: false, handsComp: hands)) | ||
| { | ||
| QueueDel(hit); | ||
| return; | ||
| } | ||
| else | ||
| comp.NeedItems = false; | ||
| } | ||
| } | ||
| var weaponquery = EntityQueryEnumerator<ImperialNothingThereGoodbyeComponent>(); | ||
| while (weaponquery.MoveNext(out var wpnuid, out var wpncomp)) | ||
| { | ||
| var curTime = _gameTiming.CurTime; | ||
| if (wpncomp.WeaponUser == EntityUid.Invalid || wpncomp.AttackEnd < curTime) | ||
| continue; | ||
| var user = wpncomp.WeaponUser; | ||
| if (!TryComp<HandsComponent>(user, out var hands)) | ||
| continue; | ||
| wpncomp.AttackEnd = TimeSpan.Zero; | ||
| wpncomp.WeaponUser = EntityUid.Invalid; | ||
| var handd = _hands.GetActiveHand((user, hands)); | ||
| _hands.DoDrop((user, hands), handd!, false, false); | ||
| if (Exists(wpnuid)) | ||
| QueueDel(wpnuid); | ||
| if (TryComp<ImperialNothingThereComponent>(user, out var scp)) | ||
| { | ||
| scp.NeedItems = true; | ||
| } | ||
| } | ||
| } | ||
| #endregion | ||
| #region Goodbye Handle | ||
| private void OnGoodbyeAction(Entity<ImperialNothingThereComponent> ent, ref ImperialNothingThereGoodbyeEvent args) | ||
| { | ||
| if (args.Handled) | ||
| return; | ||
|
|
||
| var doAfterArgs = new DoAfterArgs(EntityManager, ent, ent.Comp.GoodbyeDelay, new ImperialNothingThereGoodbyeDoAfterEvent(), ent) | ||
| { | ||
| BreakOnMove = true, | ||
| BreakOnDamage = false, | ||
| NeedHand = false | ||
| }; | ||
|
Comment on lines
+80
to
+85
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Привяжите do-after к исходному предмету и руке. Сейчас Also applies to: 82-89 🤖 Prompt for AI Agents |
||
| if (!TryComp<MobStateComponent>(args.Performer, out var mob)) | ||
| return; | ||
| if (!TryComp<ImperialNothingThereComponent>(args.Performer, out var comp)) | ||
| return; | ||
| if (_doAfterSystem.TryStartDoAfter(doAfterArgs)) | ||
| { | ||
| args.Handled = true; | ||
| _popupSystem.PopupEntity(Loc.GetString("nothing-there-goodbye-windup"), ent, PopupType.MediumCaution); | ||
| } | ||
| args.Handled = true; | ||
| } | ||
| private void OnGoodbyeDoAfter(Entity<ImperialNothingThereComponent> ent, ref ImperialNothingThereGoodbyeDoAfterEvent args) | ||
| { | ||
| if (args.Cancelled || args.Handled) | ||
| return; | ||
|
|
||
| var hands = EnsureComp<HandsComponent>(args.User); | ||
| var handd = _hands.GetActiveHand((args.User, hands)); | ||
| var wpn = _hands.GetActiveItem((args.User, hands)); | ||
| var user = args.User; | ||
| _hands.DoDrop((args.User, hands), handd!, false, false); | ||
| QueueDel(wpn); | ||
| ent.Comp.NeedGoodbye = true; | ||
| ent.Comp.NeedItems = true; | ||
| } | ||
|
|
||
| private void OnGoodbyeAttack(EntityUid uid, ImperialNothingThereGoodbyeComponent comp, ref MeleeHitEvent args) | ||
| { | ||
| if (comp.Used || args.Handled) | ||
| return; | ||
| if (!TryComp<HandsComponent>(args.User, out var hands)) | ||
| return; | ||
| args.Handled = true; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Исправить форматирование |
||
| _audio.PlayPvs(comp.EmpowerSound, args.User); | ||
| comp.Used = true; | ||
| var user = args.User; | ||
| var handd = _hands.GetActiveHand((user, hands)); | ||
| comp.WeaponUser = user; | ||
| var curTime = _gameTiming.CurTime; | ||
| comp.AttackEnd = curTime + comp.AttackDuration; | ||
| } | ||
| #endregion | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Передача строки излишне