Фиксы и фичи еще раз (#426)

* fix: constructs are cultists now

* rename: announcementPrototype -> arrivalNotificationPrototype

* fix: fix naming

* fix: hop became head

* resprite: cult bola looks like cult stuff now

* add: repsrite files

* translation: translation for cult bola

* tweak: now bola fits in belt

* refactor: refactor KnockDownOnCollideSystem

* tweak: bolas knockdown on hit

* add: energy bola

* cleanup: less components
This commit is contained in:
ThereDrD0
2024-07-06 09:34:29 +03:00
committed by GitHub
parent ccbbeb1d02
commit d9b8325fa7
27 changed files with 134 additions and 40 deletions

View File

@@ -17,12 +17,12 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
private List<GhostWarpPlayer> _playerWarps = new();
private List<GhostWarpPlace> _placeWarps = new();
private List<GhostWarpGlobalAntagonist> _globalAntoginists = new();
private List<GhostWarpGlobalAntagonist> _globalAntagonists = new();
private List<GhostWarpPlayer> _alivePlayers = new();
private List<GhostWarpPlayer> _leftPlayers = new();
private List<GhostWarpPlayer> _deadPlayers = new();
private List<GhostWarpPlayer> _ghostPlayers = new();
private readonly List<GhostWarpPlayer> _alivePlayers = new();
private readonly List<GhostWarpPlayer> _leftPlayers = new();
private readonly List<GhostWarpPlayer> _deadPlayers = new();
private readonly List<GhostWarpPlayer> _ghostPlayers = new();
public event Action<NetEntity>? WarpClicked;
@@ -37,7 +37,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
GhostTeleportContainter.DisposeAllChildren();
_playerWarps = GetSortedPlayers(_playerWarps);
_placeWarps = GetSortedPlaces(_placeWarps);
_globalAntoginists = GetSortedAntagonists(_globalAntoginists);
_globalAntagonists = GetSortedAntagonists(_globalAntagonists);
PlayersAllocation();
AddButtons();
@@ -47,12 +47,12 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
{
_playerWarps = players;
_placeWarps = places;
_globalAntoginists = antagonists;
_globalAntagonists = antagonists;
}
private void AddButtons()
{
AddAntagButtons(_globalAntoginists, "ghost-teleport-menu-antagonists-label", "ButtonColorAntagonistDepartment");
AddAntagButtons(_globalAntagonists, "ghost-teleport-menu-antagonists-label", "ButtonColorAntagonistDepartment");
AddPlayerButtons(_alivePlayers, "ghost-teleport-menu-alive-label", string.Empty, true); // Alive
AddPlayerButtons(_deadPlayers, "ghost-teleport-menu-dead-label", string.Empty, true); // Dead
AddPlayerButtons(_ghostPlayers, "ghost-teleport-menu-ghosts-label", string.Empty, true); // Ghost
@@ -239,7 +239,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
GhostTeleportContainter.AddChild(bigGrid);
}
public List<List<GhostWarpPlayer>> SortPlayersByDepartment(List<GhostWarpPlayer> players)
private List<List<GhostWarpPlayer>> SortPlayersByDepartment(List<GhostWarpPlayer> players)
{
var sortedPlayers = new List<List<GhostWarpPlayer>>();
@@ -271,7 +271,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
return sortedPlayers;
}
public List<List<GhostWarpGlobalAntagonist>> SortAntagsByWeight(List<GhostWarpGlobalAntagonist> antagonists)
private List<List<GhostWarpGlobalAntagonist>> SortAntagsByWeight(List<GhostWarpGlobalAntagonist> antagonists)
{
var sortedAntags = new List<List<GhostWarpGlobalAntagonist>>();

View File

@@ -380,7 +380,7 @@ namespace Content.Server.Ghost
return;
}
var response = new GhostWarpsResponseEvent(GetPlayerWarps(), GetLocationWarps(), GetAntagonistWarps());
var response = new GhostWarpsResponseEvent(GetPlayerWarps(), GetLocationWarps(), GetAntagonistWarps()); // WD edit
RaiseNetworkEvent(response, args.SenderSession.Channel);
}
@@ -432,7 +432,7 @@ namespace Content.Server.Ghost
}
private List<GhostWarpPlace> GetLocationWarps()
private List<GhostWarpPlace> GetLocationWarps() // WD added
{
var warps = new List<GhostWarpPlace> { };
var allQuery = AllEntityQuery<WarpPointComponent>();
@@ -448,7 +448,7 @@ namespace Content.Server.Ghost
return warps;
}
private List<GhostWarpPlayer> GetPlayerWarps()
private List<GhostWarpPlayer> GetPlayerWarps() // WD added
{
var warps = new List<GhostWarpPlayer> { };
@@ -499,7 +499,7 @@ namespace Content.Server.Ghost
return warps;
}
private List<GhostWarpGlobalAntagonist> GetAntagonistWarps()
private List<GhostWarpGlobalAntagonist> GetAntagonistWarps() // WD added
{
var warps = new List<GhostWarpGlobalAntagonist> { };

View File

@@ -30,10 +30,10 @@ public sealed class ArrivalNotificationSystem : EntitySystem
if (!_prototypeManager.TryIndex<JobPrototype>(args.JobId, out var jobPrototype))
return;
if (jobPrototype.AnnouncementPrototype == null)
if (jobPrototype.ArrivalNotificationPrototype == null)
return;
if (!_prototypeManager.TryIndex<ArrivalNotificationPrototype>(jobPrototype.AnnouncementPrototype, out var notification))
if (!_prototypeManager.TryIndex<ArrivalNotificationPrototype>(jobPrototype.ArrivalNotificationPrototype, out var notification))
return;
var message = GetMessage(args.Mob,

View File

@@ -204,7 +204,7 @@ namespace Content.Shared.Ghost
/// Contains players, and locations a ghost can warp to
/// </summary>
[Serializable, NetSerializable]
public sealed class GhostWarpsResponseEvent : EntityEventArgs
public sealed class GhostWarpsResponseEvent : EntityEventArgs // WD edit
{
public GhostWarpsResponseEvent(List<GhostWarpPlayer> players, List<GhostWarpPlace> places, List<GhostWarpGlobalAntagonist> antagonists)
{

View File

@@ -50,7 +50,7 @@ namespace Content.Shared.Roles
public bool JoinNotifyCrew { get; private set; } = false;
[DataField]
public string? AnnouncementPrototype;
public string? ArrivalNotificationPrototype;
[DataField]
public bool RequireAdminNotify { get; private set; } = false;

View File

@@ -61,15 +61,15 @@ public abstract class SharedJobSystem : EntitySystem
{
// Not that many departments so we can just eat the cost instead of storing the inverse lookup.
var departmentProtos = _protoManager.EnumeratePrototypes<DepartmentPrototype>().ToList();
departmentProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal));
departmentProtos = departmentProtos.OrderByDescending(d => d.Weight).ToList();
foreach (var department in departmentProtos)
{
if (department.Roles.Contains(jobProto))
{
departmentPrototype = department;
return true;
}
if (!department.Roles.Contains(jobProto))
continue;
departmentPrototype = department;
return true;
}
departmentPrototype = null;

View File

@@ -5,4 +5,7 @@ public sealed partial class KnockdownOnCollideComponent : Component
{
[DataField]
public float BlurTime = 20f;
[DataField]
public bool UseBlur;
}

View File

@@ -2,6 +2,7 @@ using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Projectiles;
using Content.Shared.Standing.Systems;
using Content.Shared.StatusEffect;
using Content.Shared.Throwing;
namespace Content.Shared._White.Knockdown;
@@ -15,16 +16,24 @@ public sealed class KnockdownOnCollideSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<KnockdownOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
SubscribeLocalEvent<KnockdownOnCollideComponent, ThrowDoHitEvent>(OnEntityHit);
}
private void OnEntityHit(Entity<KnockdownOnCollideComponent> ent, ref ThrowDoHitEvent args)
{
ApplyEffects(args.Target, ent.Comp);
}
private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
{
_standing.TryLieDown(args.Target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop);
ApplyEffects(args.Target, ent.Comp);
}
if (ent.Comp.BlurTime <= 0f)
return;
private void ApplyEffects(EntityUid target, KnockdownOnCollideComponent component)
{
_standing.TryLieDown(target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop);
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(args.Target, "BlurryVision",
TimeSpan.FromSeconds(ent.Comp.BlurTime), true);
if (component.UseBlur)
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(target, "BlurryVision", TimeSpan.FromSeconds(component.BlurTime), true);
}
}

View File

@@ -50,4 +50,13 @@ salvage-expedition-difficulty-Minor = Незначительная
ent-ToySwordDouble = двойной игрушечный меч
# Cult
ent-CultBola = магическая { ent-Bola }
.desc = { ent-Bola.desc }
.suffic = культ
# Energy bola
ent-EnergyBola = энергобола
.desc = Соверешенное слияние технологии и справедливости для отлова преступников.

View File

@@ -7,7 +7,7 @@
SmokeGrenade: 6
GrenadeStinger: 4
Flash: 7
Bola: 7
EnergyBola: 7
Tourniquet: 7
FlashlightSeclite: 5
ClothingEyesGlassesSunglasses: 2

View File

@@ -519,6 +519,7 @@
- SmokeOnTrigger
- Flash
- Handcuff
- Ensnaring
- type: ItemMapper
mapLayers:
flashbang:

View File

@@ -26,4 +26,3 @@
hard: false
mask:
- Opaque
- type: KnockdownOnCollide

View File

@@ -34,3 +34,4 @@
True: { state: icon }
False: { state: empty }
- type: Appearance
useBlur: true

View File

@@ -44,9 +44,12 @@
breakoutTime: 3.5 #all bola should generally be fast to remove
walkSpeed: 0.7 #makeshift bola shouldn't slow too much
sprintSpeed: 0.7
staminaDamage: 55 # Sudden weight increase sapping stamina
staminaDamage: 33 # Sudden weight increase sapping stamina
canThrowTrigger: true
canMoveBreakout: true
- type: KnockdownOnCollide
# WD added
- type: entity
parent: Bola
@@ -54,9 +57,42 @@
name: Bola
description: Linked together with some spare cuffs and metal.
components:
- type: Sprite
sprite: White/Cult/bola.rsi
- type: Ensnaring
freeTime: 2.0
breakoutTime: 3.5 #all bola should generally be fast to remove
walkSpeed: 0.5
sprintSpeed: 0.5
canThrowTrigger: true
- type: entity
parent: Bola
id: EnergyBola
name: Bola
description: Linked together with some spare cuffs and metal.
components:
- type: Item
size: Small
- type: Sprite
sprite: White/Objects/Weapons/Throwable/energybola.rsi
- type: Ensnaring
freeTime: 1
breakoutTime: 2
walkSpeed: 0.8
sprintSpeed: 0.8
staminaDamage: 33
- type: EmitSoundOnLand
collection: sparks
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 10
behaviors:
- !type:PlaySoundBehavior
sound:
collection: EnergyMiss
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: KnockdownOnCollide

View File

@@ -15,7 +15,7 @@
weight: 10
startingGear: QuartermasterGear
icon: "JobIconQuarterMaster"
announcementPrototype: QuartermasterArrivalNotification
arrivalNotificationPrototype: QuartermasterArrivalNotification
supervisors: job-supervisors-captain
whitelistedSpecies:
- Human

View File

@@ -20,7 +20,7 @@
icon: "JobIconCaptain"
requireAdminNotify: true
joinNotifyCrew: true
announcementPrototype: CaptainArrivalNotification
arrivalNotificationPrototype: CaptainArrivalNotification
supervisors: job-supervisors-centcom
whitelistedSpecies:
- Human

View File

@@ -19,7 +19,7 @@
startingGear: HoPGear
icon: "JobIconHeadOfPersonnel"
requireAdminNotify: true
announcementPrototype: HeadOfPersonnelArrivalNotification
arrivalNotificationPrototype: HeadOfPersonnelArrivalNotification
supervisors: job-supervisors-captain
whitelistedSpecies:
- Human

View File

@@ -16,7 +16,7 @@
startingGear: ChiefEngineerGear
icon: "JobIconChiefEngineer"
requireAdminNotify: true
announcementPrototype: ChiefEngineerArrivalNotification
arrivalNotificationPrototype: ChiefEngineerArrivalNotification
supervisors: job-supervisors-captain
whitelistedSpecies:
- Human

View File

@@ -14,7 +14,7 @@
time: 36000 #10 hrs
startingGear: InspectorGear
icon: "JobIconInspector"
announcementPrototype: InspectorArrivalNotification
arrivalNotificationPrototype: InspectorArrivalNotification
supervisors: job-supervisors-captain
access:
- Service

View File

@@ -14,7 +14,7 @@
weight: 10
startingGear: CMOGear
icon: "JobIconChiefMedicalOfficer"
announcementPrototype: ChiefMedicalOfficerArrivalNotification
arrivalNotificationPrototype: ChiefMedicalOfficerArrivalNotification
requireAdminNotify: true
supervisors: job-supervisors-captain
whitelistedSpecies:

View File

@@ -13,7 +13,7 @@
startingGear: ResearchDirectorGear
icon: "JobIconResearchDirector"
requireAdminNotify: true
announcementPrototype: ResearchDirectorArrivalNotification
arrivalNotificationPrototype: ResearchDirectorArrivalNotification
supervisors: job-supervisors-captain
whitelistedSpecies:
- Human

View File

@@ -16,7 +16,7 @@
startingGear: HoSGear
icon: "JobIconHeadOfSecurity"
requireAdminNotify: true
announcementPrototype: HeadOfSecurityArrivalNotification
arrivalNotificationPrototype: HeadOfSecurityArrivalNotification
supervisors: job-supervisors-captain
whitelistedSpecies:
- Human

View File

@@ -79,6 +79,8 @@
- DoorBumpOpener
- type: NameIdentifier
group: Construct
- type: GlobalAntagonist
antagonistPrototype: globalAntagonistCult
- type: entity
id: JuggernautConstruct

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

View File

@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Citadel Station at https://github.com/Citadel-Station-13/Citadel-Station-13/commit/3cfea7eb92246d311de8b531347795bc76d6dab6",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

View File

@@ -0,0 +1,20 @@
{
"version": 1,
"license": null,
"copyright": null,
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon",
"delays": [
[
0.1,
0.1
]
]
}
]
}