-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # Description Psychognomy is a passive power that gives you a descriptor on the origin of a telepathic message. There's enough of them that are ambiguous enough. I also changed Oracle and Sophia a little bit, giving them innate psionic powers. :cl: Rane - add: Added Psychognomy. - tweak: Reverted Sophia name change. - tweak: Minor tweaks to psionic chat eligibility and formatting. - add: Some new utility has been added to player-controlled Oracle or Sophia. NPC functionality later :^) --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: VMSolidus <[email protected]>
- Loading branch information
1 parent
ed8a00a
commit b2fc8b3
Showing
17 changed files
with
327 additions
and
21 deletions.
There are no files selected for viewing
171 changes: 171 additions & 0 deletions
171
Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
using Content.Shared.Humanoid; | ||
using Content.Shared.Damage; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Shared.Physics; | ||
using Content.Shared.Speech; | ||
using Content.Shared.Speech.Muting; | ||
using Content.Shared.CombatMode.Pacification; | ||
using Content.Shared.CombatMode; | ||
using Content.Shared.Nutrition.Components; | ||
using Content.Server.Vampiric; | ||
using Content.Shared.Abilities.Psionics; | ||
using Content.Server.Abilities.Psionics; | ||
using Content.Server.Cloning.Components; | ||
using Content.Server.Psionics.Glimmer; | ||
using Robust.Shared.GameObjects.Components.Localization; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Physics; | ||
using Robust.Shared.Physics.Components; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Server.Chat; | ||
public sealed partial class TelepathicChatSystem | ||
{ | ||
public string SourceToDescriptor(EntityUid source) | ||
{ | ||
var ev = new GetPsychognomicDescriptorEvent(); | ||
RaiseLocalEvent(source, ev); | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-ignorant")); | ||
|
||
return _random.Pick(ev.Descriptors); | ||
} | ||
private void InitializePsychognomy() | ||
{ | ||
SubscribeLocalEvent<HumanoidAppearanceComponent, GetPsychognomicDescriptorEvent>(DescribeHumanoid); | ||
SubscribeLocalEvent<GrammarComponent, GetPsychognomicDescriptorEvent>(DescribeGrammar); | ||
SubscribeLocalEvent<DamageableComponent, GetPsychognomicDescriptorEvent>(DescribeDamage); | ||
SubscribeLocalEvent<MobStateComponent, GetPsychognomicDescriptorEvent>(DescribeMobState); | ||
SubscribeLocalEvent<HungerComponent, GetPsychognomicDescriptorEvent>(DescribeHunger); | ||
SubscribeLocalEvent<PhysicsComponent, GetPsychognomicDescriptorEvent>(DescribePhysics); | ||
SubscribeLocalEvent<FixturesComponent, GetPsychognomicDescriptorEvent>(DescribeFixtures); | ||
SubscribeLocalEvent<MetempsychosisKarmaComponent, GetPsychognomicDescriptorEvent>(DescribeKarma); | ||
SubscribeLocalEvent<GlimmerSourceComponent, GetPsychognomicDescriptorEvent>(DescribeGlimmerSource); | ||
SubscribeLocalEvent<PsionicComponent, GetPsychognomicDescriptorEvent>(DescribePsion); | ||
SubscribeLocalEvent<InnatePsionicPowersComponent, GetPsychognomicDescriptorEvent>(DescribeInnatePsionics); | ||
SubscribeLocalEvent<BloodSuckerComponent, GetPsychognomicDescriptorEvent>(DescribeBloodsucker); | ||
} | ||
|
||
private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.Sex != Sex.Unsexed) | ||
ev.Descriptors.Add(component.Sex == Sex.Male ? Loc.GetString("p-descriptor-male") : Loc.GetString("p-descriptor-female")); | ||
|
||
// Deliberately obfuscating a bit; psionic signatures use different standards | ||
ev.Descriptors.Add(component.Age >= 100 ? Loc.GetString("p-descriptor-old") : Loc.GetString("p-descriptor-young")); | ||
} | ||
|
||
private void DescribeGrammar(EntityUid uid, GrammarComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.Gender == Gender.Male || component.Gender == Gender.Female) | ||
ev.Descriptors.Add(component.Gender == Gender.Male ? Loc.GetString("p-descriptor-masculine") : Loc.GetString("p-descriptor-feminine")); | ||
} | ||
|
||
private void DescribeDamage(EntityUid uid, DamageableComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.DamageContainerID == "CorporealSpirit") | ||
{ | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); | ||
if (!HasComp<HumanoidAppearanceComponent>(uid)) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); | ||
return; | ||
} | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-hylic")); | ||
} | ||
|
||
private void DescribeMobState(EntityUid uid, MobStateComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.CurrentState != Shared.Mobs.MobState.Critical) | ||
return; | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); | ||
} | ||
|
||
private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.CurrentThreshold > HungerThreshold.Peckish) | ||
return; | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); | ||
} | ||
|
||
private void DescribeFixtures(EntityUid uid, FixturesComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
foreach (var fixture in component.Fixtures.Values) | ||
if (fixture.CollisionMask == (int) CollisionGroup.GhostImpassable) | ||
{ | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-pneumatic")); | ||
return; | ||
} | ||
} | ||
|
||
private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.FixturesMass < 45) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-light")); | ||
else if (component.FixturesMass > 70) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-heavy")); | ||
} | ||
|
||
private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.Score == 0) | ||
return; | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); | ||
} | ||
|
||
private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.AddToGlimmer) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); | ||
else | ||
{ | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); | ||
} | ||
} | ||
|
||
// This one's also a bit of a catch-all for "lacks component" | ||
private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
if (component.PsychognomicDescriptors != null) | ||
{ | ||
foreach (var descriptor in component.PsychognomicDescriptors) | ||
{ | ||
ev.Descriptors.Add(Loc.GetString(descriptor)); | ||
} | ||
} | ||
|
||
if (!HasComp<SpeechComponent>(uid) || HasComp<MutedComponent>(uid)) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-dumb")); | ||
|
||
if (!HasComp<CombatModeComponent>(uid) || HasComp<PacifiedComponent>(uid)) | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-passive")); | ||
|
||
foreach (var power in component.ActivePowers) | ||
{ | ||
// TODO: Mime counts too and isn't added back to psions yet | ||
if (power.ID != "PyrokinesisPower" && power.ID != "NoosphericZapPower") | ||
continue; | ||
|
||
ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); | ||
return; | ||
} | ||
} | ||
|
||
private void DescribeInnatePsionics(EntityUid uid, InnatePsionicPowersComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-gnostic")); | ||
} | ||
|
||
private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, GetPsychognomicDescriptorEvent ev) | ||
{ | ||
ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); | ||
} | ||
} | ||
public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs | ||
{ | ||
public List<String> Descriptors = new List<String>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Content.Shared.Psionics.Passives; | ||
|
||
[RegisterComponent] | ||
public sealed partial class PsychognomistComponent : Component { } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
p-descriptor-mysterious = mysterious | ||
p-descriptor-male = male | ||
p-descriptor-female = female | ||
p-descriptor-young = young | ||
p-descriptor-old = old | ||
p-descriptor-masculine = masculine | ||
p-descriptor-feminine = feminine | ||
p-descriptor-hylic = hylic | ||
p-descriptor-pneumatic = pneumatic | ||
p-descriptor-liminal = liminal | ||
p-descriptor-bound = bound | ||
p-descriptor-ignorant = ignorant | ||
p-descriptor-demiurgic = demiurgic | ||
p-descriptor-emanative = emanative | ||
p-descriptor-light = light | ||
p-descriptor-heavy = heavy | ||
p-descriptor-cyclic = cyclic | ||
p-descriptor-hungry = hungry | ||
p-descriptor-vampiric = vampiric | ||
p-descriptor-kinetic = kinetic | ||
p-descriptor-gnostic = gnostic | ||
p-descriptor-dumb = dumb | ||
p-descriptor-passive = passive |
Oops, something went wrong.