Aspect tweaks (#418)

* Aspect tweaks

* Add DancingAspect

* Remove jump
This commit is contained in:
Aviu00
2023-09-19 19:02:08 +09:00
committed by Aviu00
parent 2cd3a4288f
commit bd58beb0ea
15 changed files with 189 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
using Content.Server.Administration.Logs;
using Content.Server.Hands.Systems;
using Content.Server.White.Other;
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Robust.Server.Audio;
@@ -90,6 +92,8 @@ public sealed class RandomGiftSystem : EntitySystem
var itemCompName = _componentFactory.GetComponentName(typeof(ItemComponent));
var mapGridCompName = _componentFactory.GetComponentName(typeof(MapGridComponent));
var physicsCompName = _componentFactory.GetComponentName(typeof(PhysicsComponent));
var giftIgnoreCompName = _componentFactory.GetComponentName(typeof(GiftIgnoreComponent)); // WD
var unremovableCompName = _componentFactory.GetComponentName(typeof(UnremoveableComponent)); // WD
foreach (var proto in _prototype.EnumeratePrototypes<EntityPrototype>())
{
@@ -98,7 +102,9 @@ public sealed class RandomGiftSystem : EntitySystem
_possibleGiftsUnsafe.Add(proto.ID);
if (!proto.Components.ContainsKey(itemCompName) || proto.SetSuffix is "DEBUG" or "Admeme") // WD EDIT
if (!proto.Components.ContainsKey(itemCompName) || proto.Components.ContainsKey(giftIgnoreCompName) ||
proto.Components.ContainsKey(unremovableCompName) || proto.SetSuffix != null &&
(proto.SetSuffix.Contains("DEBUG") || proto.SetSuffix.Contains("Admeme"))) // WD EDIT
continue;
_possibleGiftsSafe.Add(proto.ID);

View File

@@ -0,0 +1,9 @@
namespace Content.Server.Animations;
[RegisterComponent]
public sealed class DancingComponent : Component
{
public float AccumulatedFrametime;
public float NextDelay;
}

View File

@@ -0,0 +1,54 @@
using Content.Shared.Animations;
using Content.Shared.Bed.Sleep;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Random;
namespace Content.Server.Animations;
public sealed class DancingSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly EmoteAnimationSystem _emoteAnimation = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
private readonly string[] _emoteList = {"EmoteFlip", "EmoteTurn"};
public override void Initialize()
{
SubscribeLocalEvent<DancingComponent, ComponentInit>(OnInit);
}
private void OnInit(EntityUid uid, DancingComponent component, ComponentInit args)
{
ResetDelay(component);
}
public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<DancingComponent, EmoteAnimationComponent, MobStateComponent>();
while (query.MoveNext(out var uid, out var dancing, out var emote, out var mobState))
{
if (!_mobState.IsAlive(uid, mobState) || HasComp<SleepingComponent>(uid))
continue;
dancing.AccumulatedFrametime += frameTime;
if (dancing.AccumulatedFrametime < dancing.NextDelay)
continue;
dancing.AccumulatedFrametime -= dancing.NextDelay;
ResetDelay(dancing);
_emoteAnimation.PlayEmoteAnimation(uid, emote, _random.Pick(_emoteList));
}
}
private void ResetDelay(DancingComponent component)
{
component.NextDelay = _random.NextFloat() + 0.2f;
}
}

View File

@@ -18,14 +18,14 @@ public sealed class BombassAspect : AspectSystem<BombassAspectComponent>
private void SpawnMines()
{
var minMines = _random.Next(35, 100);
var minMines = _random.Next(30, 50);
for (var i = 0; i < minMines; i++)
{
if (!TryFindRandomTile(out _, out _, out _, out var targetCoords))
break;
EntityManager.SpawnEntity("LandMineExplosive", targetCoords);
EntityManager.SpawnEntity("LandMineAspectExplosive", targetCoords);
}
}
}

View File

@@ -0,0 +1,6 @@
namespace Content.Server.White.AspectsSystem.Aspects.Components;
[RegisterComponent]
public sealed class DancingAspectComponent : Component
{
}

View File

@@ -0,0 +1,45 @@
using Content.Server.Animations;
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.Shared.Animations;
using Content.Shared.Mobs.Components;
namespace Content.Server.White.AspectsSystem.Aspects;
public sealed class DancingAspect : AspectSystem<DancingAspectComponent>
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(HandleLateJoin);
}
protected override void Started(EntityUid uid, DancingAspectComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);
var query = EntityQueryEnumerator<EmoteAnimationComponent, MobStateComponent>();
while (query.MoveNext(out var ent, out _, out _))
{
EnsureComp<DancingComponent>(ent);
}
}
private void HandleLateJoin(PlayerSpawnCompleteEvent ev)
{
var query = EntityQueryEnumerator<DancingAspectComponent, GameRuleComponent>();
while (query.MoveNext(out var ruleEntity, out _, out var gameRule))
{
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))
continue;
if (!ev.LateJoin)
return;
var mob = ev.Mob;
EnsureComp<DancingComponent>(mob);
}
}
}

View File

@@ -18,7 +18,7 @@ public sealed class PresentAspect : AspectSystem<PresentAspectComponent>
private void SpawnPresents()
{
var minPresents = _random.Next(70, 200);
var minPresents = _random.Next(150, 200);
for (var i = 0; i < minPresents; i++)
{

View File

@@ -107,7 +107,7 @@ namespace Content.Server.White.AspectsSystem.Aspects
}
}
_chatSystem.DispatchGlobalAnnouncement(msg, "Мяукиман Крысус");
_chatSystem.DispatchGlobalAnnouncement(msg, "Мяукиман Крысус", colorOverride: Color.Aquamarine);
ForceEndSelf(uid, rule);
}

View File

@@ -0,0 +1,6 @@
namespace Content.Server.White.Other;
[RegisterComponent]
public sealed class GiftIgnoreComponent : Component
{
}

View File

@@ -812,7 +812,7 @@
damageCoefficient: 0.2
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitDeathsquad
- type: GiftIgnore
#CBURN Hardsuit
- type: entity

View File

@@ -1,4 +1,4 @@
- type: entity
- type: entity
id: BaseLandMine
abstract: true
components:
@@ -67,8 +67,22 @@
- type: ExplodeOnTrigger
- type: Explosive
explosionType: Default
maxIntensity: 3
intensitySlope: 1
totalIntensity: 120
maxIntensity: 10
intensitySlope: 3
totalIntensity: 120 # about a ~4 tile radius
canCreateVacuum: false
- type: DeleteOnTrigger
- type: entity
name: мина аспекта
parent: BaseLandMine
id: LandMineAspectExplosive
components:
- type: ExplodeOnTrigger
- type: Explosive
explosionType: Default
maxIntensity: 4
intensitySlope: 2
totalIntensity: 25
canCreateVacuum: false
- type: DeleteOnTrigger

View File

@@ -192,3 +192,16 @@
startAudio:
path: /Audio/White/Aspects/accent.ogg
- type: PresentAspect
- type: entity
id: DancingAspect
parent: BaseGameRule
noSpawn: true
components:
- type: Aspect
name: "Dance"
description: "Танцуют все!"
weight: 3
startAudio:
path: /Audio/White/Aspects/accent.ogg
- type: DancingAspect

View File

@@ -11,6 +11,7 @@
sprite: White/Fluff/centurion/deathsquad.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetCapDeathSquadFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitCap
@@ -37,6 +38,7 @@
sprite: White/Fluff/centurion/deathsquad.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitEngineeringWhiteDeathSquadFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitEngineeringWhite
@@ -63,6 +65,7 @@
sprite: White/Fluff/centurion/deathsquad.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitMedicalDeathSquadFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitMedical
@@ -89,6 +92,7 @@
sprite: White/Fluff/centurion/deathsquad.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitSecurityRedDeathSquadFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitSecurityRed
@@ -115,6 +119,7 @@
sprite: White/Fluff/centurion/deathsquad.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitRdDeathSquadFluff
- type: GiftIgnore
# Utilizator
- type: entity
@@ -129,6 +134,7 @@
sprite: White/Fluff/centurion/breacher.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitSalvageCenturion
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitSalvage
@@ -140,6 +146,7 @@
sprite: White/Fluff/centurion/breacher-helmet.rsi
- type: Clothing
sprite: White/Fluff/centurion/breacher-helmet.rsi
- type: GiftIgnore
# Security
- type: entity
@@ -154,6 +161,7 @@
sprite: White/Fluff/centurion/breacher.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitSecurityCenturion
- type: GiftIgnore
# poxuy
@@ -176,6 +184,7 @@
sprite: White/Fluff/centurion/breacher-helmet.rsi
- type: Clothing
sprite: White/Fluff/centurion/breacher-helmet.rsi
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitRd

View File

@@ -19,6 +19,7 @@
- type: ContainerContainer
containers:
toggleable-clothing: !type:ContainerSlot {}
- type: GiftIgnore
- type: entity
parent: ClothingOuterHardsuitEVA
@@ -35,6 +36,7 @@
- type: ContainerContainer
containers:
toggleable-clothing: !type:ContainerSlot { }
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetEVA
@@ -46,6 +48,7 @@
sprite: White/Fluff/DOOMMAX/helmetglamour.rsi
- type: Clothing
sprite: White/Fluff/DOOMMAX/helmetglamour.rsi
- type: GiftIgnore
# Maury
- type: entity
@@ -134,6 +137,7 @@
sprite: White/Fluff/YouWellLeer/hoshardsuit.rsi
- type: ToggleableClothing
clothingPrototype: LeerHelmet
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitSecurityRed
@@ -146,6 +150,7 @@
- type: Clothing
sprite: White/Fluff/YouWellLeer/hoshelmet.rsi
- type: PointLight
- type: GiftIgnore
- type: entity
parent: ClothingUniformJumpsuitHoS
@@ -351,6 +356,7 @@
damageCoefficient: 0.90
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitHskveezAtmos
- type: GiftIgnore
#Hskveez Atmospherics Hardsuit

View File

@@ -18,6 +18,7 @@
- type: ContainerContainer
containers:
toggleable-clothing: !type:ContainerSlot {}
- type: GiftIgnore
#CAP
- type: entity
@@ -32,6 +33,7 @@
sprite: Clothing/OuterClothing/Hardsuits/ERTSuits/ertleader.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitERTLeader
- type: GiftIgnore
#CE
- type: entity
@@ -45,6 +47,7 @@
sprite: Clothing/OuterClothing/Hardsuits/ERTSuits/ertengineer.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitERTEngineer
- type: GiftIgnore
#CMO
- type: entity
@@ -58,6 +61,7 @@
sprite: Clothing/OuterClothing/Hardsuits/ERTSuits/ertmedical.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitERTMedical
- type: GiftIgnore
#SEC
- type: entity
@@ -71,6 +75,7 @@
sprite: Clothing/OuterClothing/Hardsuits/ERTSuits/ertsecurity.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitERTSecurity
- type: GiftIgnore
# RD
- type: entity
@@ -84,6 +89,7 @@
sprite: Clothing/OuterClothing/Hardsuits/ERTSuits/ertjanitor.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitERTJanitor
- type: GiftIgnore
# other
- type: entity
@@ -98,6 +104,7 @@
sprite: Clothing/OuterClothing/Hardsuits/wizard.rsi
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitWizard
- type: GiftIgnore
# Penis
@@ -114,6 +121,7 @@
sprite: White/Fluff/serbwo/suits/ertleader.rsi
- type: ToggleableClothing
clothingPrototype: ClothingOuterParamedicHelmetFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHardsuitWithLightBase
@@ -125,6 +133,7 @@
sprite: White/Fluff/serbwo/helmets/ertleader.rsi
- type: Clothing
sprite: White/Fluff/serbwo/helmets/ertleader.rsi
- type: GiftIgnore
- type: entity
@@ -139,6 +148,7 @@
sprite: White/Fluff/serbwo/suits/ertmedical.rsi
- type: ToggleableClothing
clothingPrototype: ClothingOuterCargoHelmetFluff
- type: GiftIgnore
- type: entity
parent: ClothingHeadHelmetHardsuitSalvage
@@ -150,6 +160,7 @@
sprite: White/Fluff/serbwo/helmets/ertmedical.rsi
- type: Clothing
sprite: White/Fluff/serbwo/helmets/ertmedical.rsi
- type: GiftIgnore
# KILL ME PLEASE