Northstar Gloves (#16021)
* Added Gloves of North Star, no sprite or talking yet...
* Added sprites for the gloves of the north star...
* Replaced more placeholder sprites for northstar gloves...
* Added gloves of the north star to uplink...
* Added speech on hit, not yet configureable
* Not functional yet, but a step in the right direction I hope...
* IT WORKS!!
* Licensing and cleanup
* Reduced attack speed, changed from chat to popup, added some admin logging. It was causing too much adminlog spam otherwise
* Reorganized some files, final build??
* Changed the adminlog type from Verb to new type ItemConfigure
* More cleanup, fix sprite reference maybe
* Keronshb's suggestions, fixed some stuff, made hit sound use the meaty punch sfx
* Adds support for hiding speak/whisper/emote from adminlogs, makes northstar speak again!
* Some file shuffling, some of Keronshb's requests. Might appear a bit funky in github because vscode kept duplicating files for some reason and I had to delete them
* Made it work with the latest changes on Master
* Final? cleanup, upped dmg to 8, made ui not activate on activateinhand, instead you need to right click
* Set value to 0 credits, that's all
* Well that was much easier than I made it out to be. Now you can only activate the gloves with right click, no more mispredicts.
* Update MeleeWeaponSystem.cs
Iunno why this got changed in the first place, but I'm changin it back
* emptycommit
* emptycommit
* The tiny fixening
2023-05-23 11:12:30 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2022-12-28 04:03:25 +11:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Speech
|
2021-06-19 10:03:24 +02:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class SpeechSystem : EntitySystem
|
2021-06-19 10:03:24 +02:00
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
2022-01-08 00:57:20 +13:00
|
|
|
SubscribeLocalEvent<SpeakAttemptEvent>(OnSpeakAttempt);
|
2022-12-28 04:03:25 +11:00
|
|
|
SubscribeLocalEvent<SpeechComponent, ComponentGetState>(OnSpeechGetState);
|
|
|
|
|
SubscribeLocalEvent<SpeechComponent, ComponentHandleState>(OnSpeechHandleState);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetSpeech(EntityUid uid, bool value, SpeechComponent? component = null)
|
|
|
|
|
{
|
|
|
|
|
if (value && !Resolve(uid, ref component))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
component = EnsureComp<SpeechComponent>(uid);
|
|
|
|
|
|
|
|
|
|
if (component.Enabled == value)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Dirty(component);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnSpeechHandleState(EntityUid uid, SpeechComponent component, ref ComponentHandleState args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Current is not SpeechComponentState state)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
component.Enabled = state.Enabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnSpeechGetState(EntityUid uid, SpeechComponent component, ref ComponentGetState args)
|
|
|
|
|
{
|
|
|
|
|
args.State = new SpeechComponentState(component.Enabled);
|
2021-06-19 10:03:24 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-08 00:57:20 +13:00
|
|
|
private void OnSpeakAttempt(SpeakAttemptEvent args)
|
2021-06-19 10:03:24 +02:00
|
|
|
{
|
2022-12-28 04:03:25 +11:00
|
|
|
if (!TryComp(args.Uid, out SpeechComponent? speech) || !speech.Enabled)
|
2021-10-21 13:03:14 +11:00
|
|
|
args.Cancel();
|
2021-06-19 10:03:24 +02:00
|
|
|
}
|
2022-12-28 04:03:25 +11:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
private sealed class SpeechComponentState : ComponentState
|
|
|
|
|
{
|
|
|
|
|
public readonly bool Enabled;
|
|
|
|
|
|
|
|
|
|
public SpeechComponentState(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
Enabled = enabled;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-19 10:03:24 +02:00
|
|
|
}
|
|
|
|
|
}
|