Aspects (#266)
* - add: Revive fast and furious aspect. * - add: Update accents. * - add: More buzzing for moth. * - tweak: Change desc. * - fix: Fixes. * - add: RandomItemAspect. * - fix: Fix arachnid socks. * - tweak: Update desc part 2.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using Content.Server._White.Cult.GameRule;
|
||||
using Content.Server._White.Mood;
|
||||
using Content.Server._White.Other.FastAndFuriousSystem;
|
||||
using Content.Server.Administration.Systems;
|
||||
using Content.Server.Bible.Components;
|
||||
using Content.Server.Body.Components;
|
||||
@@ -998,6 +999,9 @@ public sealed partial class ChangelingSystem
|
||||
|
||||
private void TransferComponents(EntityUid from, EntityUid to)
|
||||
{
|
||||
if (HasComp<FastAndFuriousComponent>(from))
|
||||
EnsureComp<FastAndFuriousComponent>(to);
|
||||
|
||||
if (HasComp<AbsorbedComponent>(from))
|
||||
EnsureComp<AbsorbedComponent>(to);
|
||||
|
||||
|
||||
@@ -114,4 +114,11 @@ public sealed class RandomGiftSystem : EntitySystem
|
||||
_possibleGiftsSafe.Add(proto.ID);
|
||||
}
|
||||
}
|
||||
|
||||
// WD START
|
||||
public string? PickRandomItem()
|
||||
{
|
||||
return _possibleGiftsSafe.Count == 0 ? null : _random.Pick(_possibleGiftsSafe);
|
||||
}
|
||||
// WD END
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Content.Server.Speech.Components;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -8,7 +9,7 @@ namespace Content.Server.Speech.EntitySystems
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
private static readonly IReadOnlyList<string> Barks = new List<string>{
|
||||
" Woof!", " WOOF", " wof-wof"
|
||||
" Гав!", " ГАВ", " гав-гав" // WD EDIT
|
||||
}.AsReadOnly();
|
||||
|
||||
private static readonly IReadOnlyDictionary<string, string> SpecialWords = new Dictionary<string, string>()
|
||||
@@ -31,6 +32,12 @@ namespace Content.Server.Speech.EntitySystems
|
||||
message = message.Replace(word, repl);
|
||||
}
|
||||
|
||||
// WD EDIT START
|
||||
message = Regex.Replace(message, "р{1,3}", "ррр");
|
||||
|
||||
message = Regex.Replace(message, "Р{1,3}", "РРР");
|
||||
// WD EDIT END
|
||||
|
||||
return message.Replace("!", _random.Pick(Barks))
|
||||
.Replace("l", "r").Replace("L", "R");
|
||||
}
|
||||
|
||||
@@ -19,7 +19,17 @@ public sealed class MothAccentSystem : EntitySystem
|
||||
message = Regex.Replace(message, "z{1,3}", "zzz");
|
||||
// buZZZ
|
||||
message = Regex.Replace(message, "Z{1,3}", "ZZZ");
|
||||
|
||||
|
||||
// WD EDIT START
|
||||
message = Regex.Replace(message, "з{1,3}", "ззз");
|
||||
|
||||
message = Regex.Replace(message, "З{1,3}", "ЗЗЗ");
|
||||
|
||||
message = Regex.Replace(message, "ж{1,3}", "жжж");
|
||||
|
||||
message = Regex.Replace(message, "Ж{1,3}", "ЖЖЖ");
|
||||
// WD EDIT END
|
||||
|
||||
args.Message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Content.Server._White.AspectsSystem.Aspects.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class RandomItemAspectComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public string? Item;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server._White.AspectsSystem.Aspects.Components;
|
||||
using Content.Server._White.AspectsSystem.Base;
|
||||
using Content.Server._White.Other.FastAndFuriousSystem;
|
||||
using Content.Shared.Cloning;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
@@ -11,8 +12,6 @@ namespace Content.Server._White.AspectsSystem.Aspects;
|
||||
|
||||
public sealed class FastAndFuriousAspect : AspectSystem<FastAndFuriousAspectComponent>
|
||||
{
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -25,10 +24,9 @@ public sealed class FastAndFuriousAspect : AspectSystem<FastAndFuriousAspectComp
|
||||
{
|
||||
base.Started(uid, component, gameRule, args);
|
||||
var query = EntityQueryEnumerator<MovementSpeedModifierComponent>();
|
||||
while (query.MoveNext(out var ent, out var speedModifierComponent))
|
||||
while (query.MoveNext(out var ent, out _))
|
||||
{
|
||||
_movementSystem.ChangeBaseSpeed(ent, speedModifierComponent.BaseWalkSpeed,
|
||||
speedModifierComponent.BaseSprintSpeed + 3, speedModifierComponent.Acceleration);
|
||||
EnsureComp<FastAndFuriousComponent>(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +35,9 @@ public sealed class FastAndFuriousAspect : AspectSystem<FastAndFuriousAspectComp
|
||||
{
|
||||
base.Ended(uid, component, gameRule, args);
|
||||
var query = EntityQueryEnumerator<MovementSpeedModifierComponent>();
|
||||
while (query.MoveNext(out var ent, out var speedModifierComponent))
|
||||
while (query.MoveNext(out var ent, out _))
|
||||
{
|
||||
_movementSystem.ChangeBaseSpeed(ent, speedModifierComponent.BaseWalkSpeed,
|
||||
speedModifierComponent.BaseSprintSpeed, speedModifierComponent.Acceleration);
|
||||
EnsureComp<FastAndFuriousComponent>(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,11 +62,10 @@ public sealed class FastAndFuriousAspect : AspectSystem<FastAndFuriousAspectComp
|
||||
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))
|
||||
continue;
|
||||
|
||||
if (!TryComp<MovementSpeedModifierComponent>(mob, out var speedModifierComponent))
|
||||
if (!HasComp<MovementSpeedModifierComponent>(mob))
|
||||
return;
|
||||
|
||||
_movementSystem.ChangeBaseSpeed(mob, speedModifierComponent.BaseWalkSpeed,
|
||||
speedModifierComponent.BaseSprintSpeed + 3, speedModifierComponent.Acceleration);
|
||||
EnsureComp<FastAndFuriousComponent>(mob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,10 @@ public sealed class RandomAccentAspect : AspectSystem<RandomAccentAspectComponen
|
||||
Russian,
|
||||
Anime,
|
||||
Lizard,
|
||||
Backwards
|
||||
Backwards,
|
||||
Bark,
|
||||
Anxiety,
|
||||
Moth
|
||||
}
|
||||
|
||||
private void ApplyRandomAccent(EntityUid uid)
|
||||
@@ -100,6 +103,19 @@ public sealed class RandomAccentAspect : AspectSystem<RandomAccentAspectComponen
|
||||
case AccentType.Backwards:
|
||||
EntityManager.EnsureComponent<BackwardsAccentComponent>(uid);
|
||||
break;
|
||||
case AccentType.Bark:
|
||||
EntityManager.EnsureComponent<BarkAccentComponent>(uid);
|
||||
break;
|
||||
case AccentType.Anxiety:
|
||||
var stutter = EntityManager.EnsureComponent<StutteringAccentComponent>(uid);
|
||||
stutter.MatchRandomProb = 0.2f;
|
||||
stutter.FourRandomProb = 0f;
|
||||
stutter.ThreeRandomProb = 0.3f;
|
||||
stutter.CutRandomProb = 0f;
|
||||
break;
|
||||
case AccentType.Moth:
|
||||
EntityManager.EnsureComponent<MothAccentComponent>(uid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server._White.AspectsSystem.Aspects.Components;
|
||||
using Content.Server._White.AspectsSystem.Base;
|
||||
using Content.Server.Holiday.Christmas;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Humanoid;
|
||||
|
||||
namespace Content.Server._White.AspectsSystem.Aspects;
|
||||
|
||||
public sealed class RandomItemAspect : AspectSystem<RandomItemAspectComponent>
|
||||
{
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly RandomGiftSystem _giftSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(HandleLateJoin);
|
||||
}
|
||||
|
||||
protected override void Started(EntityUid uid, RandomItemAspectComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
|
||||
{
|
||||
base.Started(uid, component, gameRule, args);
|
||||
|
||||
var query = EntityQueryEnumerator<HumanoidAppearanceComponent>();
|
||||
while (query.MoveNext(out var ent, out _))
|
||||
{
|
||||
GiveItem(ent, component);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void HandleLateJoin(PlayerSpawnCompleteEvent ev)
|
||||
{
|
||||
var query = EntityQueryEnumerator<RandomItemAspectComponent, GameRuleComponent>();
|
||||
while (query.MoveNext(out var ruleEntity, out var component, out var gameRule))
|
||||
{
|
||||
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))
|
||||
continue;
|
||||
|
||||
if (!ev.LateJoin)
|
||||
return;
|
||||
|
||||
var mob = ev.Mob;
|
||||
|
||||
GiveItem(mob, component);
|
||||
}
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
|
||||
private void GiveItem(EntityUid player, RandomItemAspectComponent component)
|
||||
{
|
||||
component.Item ??= _giftSystem.PickRandomItem();
|
||||
|
||||
if (component.Item == null)
|
||||
return;
|
||||
|
||||
var transform = CompOrNull<TransformComponent>(player);
|
||||
|
||||
if(transform == null)
|
||||
return;
|
||||
|
||||
if(!HasComp<HandsComponent>(player))
|
||||
return;
|
||||
|
||||
var weaponEntity = EntityManager.SpawnEntity(component.Item, transform.Coordinates);
|
||||
|
||||
_handsSystem.PickupOrDrop(player, weaponEntity);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Content.Server._White.Other.FastAndFuriousSystem;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class FastAndFuriousComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float SprintModifier = 1.6f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float WalkModifier = 1;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Content.Shared.Movement.Systems;
|
||||
|
||||
namespace Content.Server._White.Other.FastAndFuriousSystem;
|
||||
|
||||
public sealed class FastAndFuriousSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FastAndFuriousComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<FastAndFuriousComponent, RefreshMovementSpeedModifiersEvent>(OnRefresh);
|
||||
}
|
||||
|
||||
private void OnRefresh(Entity<FastAndFuriousComponent> ent, ref RefreshMovementSpeedModifiersEvent args)
|
||||
{
|
||||
args.ModifySpeed(ent.Comp.WalkModifier, ent.Comp.SprintModifier);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<FastAndFuriousComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
_movementSpeedModifierSystem.RefreshMovementSpeedModifiers(ent);
|
||||
}
|
||||
}
|
||||
@@ -76,8 +76,6 @@
|
||||
- map: [ "enum.HumanoidVisualLayers.LArm" ]
|
||||
- map: [ "enum.HumanoidVisualLayers.RLeg" ]
|
||||
- map: [ "enum.HumanoidVisualLayers.LLeg" ]
|
||||
- map: [ "underwearb" ] #White
|
||||
- map: [ "underweart" ] #White
|
||||
- shader: StencilClear
|
||||
sprite: Mobs/Species/Human/parts.rsi #PJB on stencil clear being on the left leg: "...this is 'fine'" -https://github.com/space-wizards/space-station-14/pull/12217#issuecomment-1291677115
|
||||
# its fine, but its still very stupid that it has to be done like this instead of allowing sprites to just directly insert a stencil clear.
|
||||
@@ -88,10 +86,12 @@
|
||||
sprite: Mobs/Customization/masking_helpers.rsi
|
||||
state: unisex_full
|
||||
visible: false
|
||||
- map: ["jumpsuit"]
|
||||
- map: [ "underwearb" ] #White
|
||||
- map: [ "underweart" ] #White
|
||||
- map: ["enum.HumanoidVisualLayers.LFoot"]
|
||||
- map: ["enum.HumanoidVisualLayers.RFoot"]
|
||||
- map: [ "socks" ] #White
|
||||
- map: ["jumpsuit"]
|
||||
- map: ["enum.HumanoidVisualLayers.LHand"]
|
||||
- map: ["enum.HumanoidVisualLayers.RHand"]
|
||||
- map: [ "gloves" ]
|
||||
|
||||
@@ -11,19 +11,18 @@
|
||||
path: /Audio/White/Aspects/accent.ogg
|
||||
- type: RandomAccentAspect
|
||||
|
||||
# Disabled this cause movement speed increase isn't predicted and it feels awful due to this
|
||||
#- type: entity
|
||||
# id: FastAndFuriousAspect
|
||||
# parent: BaseGameRule
|
||||
# noSpawn: true
|
||||
# components:
|
||||
# - type: Aspect
|
||||
# name: "Fast and Furious"
|
||||
# description: "Люди спешат и не важно куда."
|
||||
# weight: 3
|
||||
# startAudio:
|
||||
# path: /Audio/White/Aspects/accent.ogg
|
||||
# - type: FastAndFuriousAspect
|
||||
- type: entity
|
||||
id: FastAndFuriousAspect
|
||||
parent: BaseGameRule
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: Aspect
|
||||
name: "Fast and Furious"
|
||||
description: "Люди спешат и не важно куда."
|
||||
weight: 3
|
||||
startAudio:
|
||||
path: /Audio/White/Aspects/accent.ogg
|
||||
- type: FastAndFuriousAspect
|
||||
|
||||
- type: entity
|
||||
id: RandomAppearanceAspect
|
||||
@@ -307,7 +306,7 @@
|
||||
components:
|
||||
- type: Aspect
|
||||
name: "Cat Ears And Tail"
|
||||
description: "Мяукайте."
|
||||
description: "Из-за ошибки в системе клонирования на ЦК все члены экипажа стали походить на фелинидов."
|
||||
weight: 3
|
||||
startAudio:
|
||||
path: /Audio/White/Aspects/accent.ogg
|
||||
@@ -322,12 +321,23 @@
|
||||
name: "Nothing"
|
||||
description: "Ничего."
|
||||
weight: 3
|
||||
startAudio:
|
||||
path: /Audio/White/Aspects/accent.ogg
|
||||
forbidden: true
|
||||
hidden: true
|
||||
- type: NothingAspect
|
||||
|
||||
- type: entity
|
||||
id: RandomItemAspect
|
||||
parent: BaseGameRule
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: Aspect
|
||||
name: "Random item"
|
||||
description: "ЦК выдало каждому члену экипажа определённый предмет."
|
||||
weight: 3
|
||||
startAudio:
|
||||
path: /Audio/White/Aspects/accent.ogg
|
||||
- type: RandomItemAspect
|
||||
|
||||
# Disabled this cause polymorph breaks stuff
|
||||
#- type: entity
|
||||
# id: SkeletonAspect
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
RLeg: MobSlimeRLeg
|
||||
LFoot: MobSlimeLFoot
|
||||
RFoot: MobSlimeRFoot
|
||||
HeadTop: MobHumanoidAnyMarking
|
||||
Tail: MobHumanoidAnyMarking
|
||||
|
||||
- type: bodyType
|
||||
id: VoxNormal
|
||||
@@ -88,6 +90,8 @@
|
||||
RLeg: MobVoxRLeg
|
||||
LFoot: MobVoxLFoot
|
||||
RFoot: MobVoxRFoot
|
||||
HeadTop: MobHumanoidAnyMarking
|
||||
Tail: MobHumanoidAnyMarking
|
||||
|
||||
- type: bodyType
|
||||
id: SkrellNormal
|
||||
@@ -105,6 +109,8 @@
|
||||
RLeg: MobSkrellRLeg
|
||||
LFoot: MobSkrellLFoot
|
||||
RFoot: MobSkrellRFoot
|
||||
HeadTop: MobHumanoidAnyMarking
|
||||
Tail: MobHumanoidAnyMarking
|
||||
|
||||
- type: bodyType
|
||||
id: DionaNormal
|
||||
@@ -122,6 +128,7 @@
|
||||
RLeg: MobDionaRLeg
|
||||
LFoot: MobDionaLFoot
|
||||
RFoot: MobDionaRFoot
|
||||
Tail: MobHumanoidAnyMarking
|
||||
|
||||
- type: bodyType
|
||||
id: ArachnidNormal
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
RLeg: MobSkrellSlimRLeg
|
||||
LFoot: MobSkrellSlimLFoot
|
||||
RFoot: MobSkrellSlimRFoot
|
||||
HeadTop: MobHumanoidAnyMarking
|
||||
Tail: MobHumanoidAnyMarking
|
||||
|
||||
# - type: bodyType
|
||||
# id: ReptilianSlim
|
||||
|
||||
Reference in New Issue
Block a user