From 36555ce7ec2aba5f8bb19ed675b2e924e7b47645 Mon Sep 17 00:00:00 2001 From: ThereDrD0 <88589686+ThereDrD0@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:50:43 +0300 Subject: [PATCH 01/15] fix map saves (#566) --- Resources/migration.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Resources/migration.yml b/Resources/migration.yml index 1281d949fc..84be52a2e6 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -269,3 +269,6 @@ ComfyChairCargo: BrownComfyChair ComfyChairService: GreenComfyChair BoxTrashbag: TrashBag + +# 2024-08-05 WD +OmntnsHammer: JudgeHammer From cdac0513ae314d1e43221c906cce2a4de770cda0 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Mon, 5 Aug 2024 15:39:34 +0300 Subject: [PATCH 02/15] - fix: Crushers and spellblade. --- Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs | 6 ++++++ .../_White/Wizard/SpellBlade/SharedSpellBladeSystem.cs | 1 + .../Prototypes/Entities/Objects/Weapons/Melee/mining.yml | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 9e5ee2d8c3..878b6cbc3a 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -554,6 +554,12 @@ public abstract partial class SharedGunSystem : EntitySystem Dirty(gun); } // WD EDIT + public void SetFireMode(GunComponent gun, SelectiveFire available, SelectiveFire selected) + { + gun.AvailableModes = available; + gun.SelectedMode = selected; + } + public void SetUseKey(GunComponent gun, bool useKey) { gun.UseKey = useKey; diff --git a/Content.Shared/_White/Wizard/SpellBlade/SharedSpellBladeSystem.cs b/Content.Shared/_White/Wizard/SpellBlade/SharedSpellBladeSystem.cs index c940d36507..918c0df502 100644 --- a/Content.Shared/_White/Wizard/SpellBlade/SharedSpellBladeSystem.cs +++ b/Content.Shared/_White/Wizard/SpellBlade/SharedSpellBladeSystem.cs @@ -103,6 +103,7 @@ public abstract class SharedSpellBladeSystem : EntitySystem var gun = EnsureComp(uid); _gun.SetUseKey(gun, false); _gun.SetClumsyProof(gun, true); + _gun.SetFireMode(gun, SelectiveFire.FullAuto, SelectiveFire.FullAuto); _gun.SetSound(uid, new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/Magic/staff_healing.ogg")); _gun.SetFireRate(uid, 1.2f); var ammoProvider = EnsureComp(uid); diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml index a92b38e27d..0d59037069 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml @@ -34,6 +34,9 @@ soundGunshot: /Audio/Weapons/plasma_cutter.ogg fireRate: 1 useKey: false + selectedMode: FullAuto + availableModes: + - FullAuto - type: RechargeBasicEntityAmmo rechargeCooldown: 0.5 rechargeSound: @@ -95,8 +98,6 @@ components: - type: Sprite sprite: Objects/Weapons/Melee/crusher_glaive.rsi - - type: UseDelay - delay: 1.9 - type: LeechOnMarker leech: groups: From 8c8188f96277f0454fee5c0d2e0364fa33740fa4 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Mon, 5 Aug 2024 15:56:25 +0300 Subject: [PATCH 03/15] - tweak: Magic tweaks. --- Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs | 7 +++++-- Resources/Prototypes/Magic/white.yml | 8 ++++---- Resources/Prototypes/_White/Wizard/magic_items.yml | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs index b69540d738..89c0ff1f2e 100644 --- a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs +++ b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Numerics; -using Content.Server._White.Cult; using Content.Server._White.IncorporealSystem; +using Content.Server._White.Other.FastAndFuriousSystem; using Content.Server._White.Wizard.Charging; using Content.Server._White.Wizard.Magic.Amaterasu; using Content.Server._White.Wizard.Magic.Other; @@ -48,6 +48,7 @@ using Content.Shared.Physics; using Content.Shared.Popups; using Content.Shared.Revolutionary.Components; using Content.Shared.StatusEffect; +using Content.Shared.Stunnable; using Content.Shared.Throwing; using Robust.Shared.Audio.Systems; using Robust.Shared.Map; @@ -88,6 +89,7 @@ public sealed class WizardSpellsSystem : EntitySystem [Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly ActionContainerSystem _actionContainer = default!; [Dependency] private readonly ChargingSystem _charging = default!; + [Dependency] private readonly SharedStunSystem _stun = default!; #endregion @@ -191,6 +193,7 @@ public sealed class WizardSpellsSystem : EntitySystem SwapComponent(uid, target); SwapComponent(uid, target); SwapComponent(uid, target); + SwapComponent(uid, target); _mindSystem.TransferTo(mindId, target, mind: mind); @@ -738,8 +741,8 @@ public sealed class WizardSpellsSystem : EntitySystem return false; } + _stun.TryKnockdown(msg.TargetUid, TimeSpan.FromSeconds(4), true); _throwingSystem.TryThrow(msg.TargetUid, Transform(msg.Performer).Coordinates, 5f); - _standing.TryLieDown(msg.TargetUid); return true; } diff --git a/Resources/Prototypes/Magic/white.yml b/Resources/Prototypes/Magic/white.yml index 0e84716b30..a2cae1c89c 100644 --- a/Resources/Prototypes/Magic/white.yml +++ b/Resources/Prototypes/Magic/white.yml @@ -29,7 +29,7 @@ prototype: ProjectileTeslaBall posData: !type:TargetCasterPos - type: VariableUseDelay - useDelay: 5 + useDelay: 10 altUseDelay: 5 chargeUseDelay: 30 @@ -63,7 +63,7 @@ speech: "EL DRITCH!" - type: VariableUseDelay useDelay: 6 - altUseDelay: 2 + altUseDelay: 3 chargeUseDelay: 30 - type: entity @@ -72,7 +72,7 @@ noSpawn: true components: - type: Magic - requiresClothes: true + requiresClothes: false - type: WorldTargetAction itemIconStyle: BigAction useDelay: 60 @@ -128,7 +128,7 @@ posData: !type:TargetCasterPos speech: "SHIZO NERO!" - type: VariableUseDelay - useDelay: 4 + useDelay: 5 altUseDelay: 1 chargeUseDelay: 30 diff --git a/Resources/Prototypes/_White/Wizard/magic_items.yml b/Resources/Prototypes/_White/Wizard/magic_items.yml index 5b6b029837..ae012dc30e 100644 --- a/Resources/Prototypes/_White/Wizard/magic_items.yml +++ b/Resources/Prototypes/_White/Wizard/magic_items.yml @@ -8,7 +8,7 @@ sprite: White/Objects/Weapons/Chaplain/hfrequency.rsi - type: MeleeWeapon autoAttack: true - attackRate: 4 + attackRate: 5 damage: types: Slash: 10 @@ -39,7 +39,7 @@ wideAnimationRotation: 135 damage: types: - Slash: 30 + Slash: 35 - type: Clothing quickEquip: false sprite: White/Objects/Weapons/Chaplain/spellblade.rsi From 945477d7e783603800da5e8e89842c71211faed3 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Mon, 5 Aug 2024 16:04:42 +0300 Subject: [PATCH 04/15] - add: Update desc. --- Resources/Locale/ru-RU/_white/wizard/spells.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/ru-RU/_white/wizard/spells.ftl b/Resources/Locale/ru-RU/_white/wizard/spells.ftl index bba48bccdc..1f75497f0f 100644 --- a/Resources/Locale/ru-RU/_white/wizard/spells.ftl +++ b/Resources/Locale/ru-RU/_white/wizard/spells.ftl @@ -5,7 +5,7 @@ ent-ActionForceSpell = Сила .desc = Притягивает все объекты и сущности в указанную точку. Альтернативный каст: Прицельно притягивает к вам предмет или сущность. При зарядке: Вместо притяжение в выбранную точку, отталкивает все объекты от заклинателя. С каждым уровнем повышается мощность отталкивания. ent-ActionFireballSpell = Огненный шар - .desc = Создает огненный шар, наносящий огромный урон при взрыве. Альтернативный каст: Поджигает одну цель на любом расстоянии, навешивая проклятие, при котором смерть от огня уничтожит тело. При зарядке: Поджигает все сущности вокруг, с каждым уровнем повышается сила поджога и радиус поражения. Не работает без волшебной мантии и шляпы. + .desc = Создает огненный шар, наносящий огромный урон при взрыве. Альтернативный каст: Поджигает одну цель на любом расстоянии, навешивая проклятие, при котором смерть от огня уничтожит тело. При зарядке: Поджигает все сущности вокруг, с каждым уровнем повышается сила поджога и радиус поражения. ent-ActionCardSpell = Карты .desc = Настоящий козырь в рукаве! Вернее, целая колода таких. Выпускает несколько смертельных карт в одном направлении. Карты способны оглушить цель. Альтернативный каст: Превращает в карту любой предмет. В карту можно превратить только предметы. При зарядке: Выпускает карты вокруг вас, с каждым уровнем зарядки количество выпускаемых карт повышается. From fb5fa92438357b6a22ffd478cfce9114172e9400 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Mon, 5 Aug 2024 16:21:45 +0300 Subject: [PATCH 05/15] - add: Blocking for melee weapons. --- .../Prototypes/Entities/Objects/Weapons/Melee/armblade.yml | 2 ++ .../Prototypes/Entities/Objects/Weapons/Melee/cult.yml | 4 ++++ .../Prototypes/Entities/Objects/Weapons/Melee/sword.yml | 6 ++++++ .../_White/Entities/Objects/Weapons/chaplain_weapons.yml | 1 + 4 files changed, 13 insertions(+) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/armblade.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/armblade.yml index 13f89950a3..9b6e5a7686 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/armblade.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/armblade.yml @@ -28,3 +28,5 @@ deleteOnDrop: true - type: ToolForcePowered - type: DeleteOnChangelingRefund + - type: MeleeBlock + delay: 12.1 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml index 7961c3af43..0cbf04eb7b 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml @@ -82,6 +82,8 @@ - suitStorage - type: DisarmMalus - type: CultItem + - type: MeleeBlock + delay: 12.1 - type: entity name: unholy halberd @@ -123,3 +125,5 @@ - type: UseDelay delay: 1 - type: CultItem + - type: MeleeBlock + delay: 12.1 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml index 9ec4e93469..3f54cf7b19 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml @@ -64,6 +64,8 @@ - Belt - SuitStorage - type: DisarmMalus + - type: MeleeBlock + delay: 12.1 - type: entity name: energy katana @@ -164,6 +166,8 @@ deconstructionTarget: null graph: SwordGraph node: sword + - type: MeleeBlock + delay: 12.1 - type: entity name: cutlass @@ -189,6 +193,8 @@ size: Large sprite: Objects/Weapons/Melee/cutlass.rsi - type: DisarmMalus + - type: MeleeBlock + delay: 12.1 - type: entity name: The Throngler diff --git a/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml b/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml index 3e0ab8c74b..0e2b6f7a68 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml @@ -341,6 +341,7 @@ sprite: White/Objects/Weapons/Chaplain/pitchfork.rsi state: icon - type: MeleeWeapon + range: 2 wideAnimationRotation: -135 damage: types: From dd208bfa75fbac076df75b162b29236e8e83d819 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:39:31 +0000 Subject: [PATCH 06/15] - add: Defib fun. (#567) --- Content.Server/Medical/DefibrillatorSystem.cs | 38 ++++++++++++-- .../Medical/DefibrillatorComponent.cs | 5 ++ .../Weapons/Melee/MeleeWeaponComponent.cs | 5 +- Content.Shared/_White/Item/DefibEmagSystem.cs | 50 +++++++++++++++++++ .../DelayedKnockdownOnHitSystem.cs | 11 +++- .../Objects/Specific/Medical/defib.yml | 3 ++ 6 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 Content.Shared/_White/Item/DefibEmagSystem.cs diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 64861fdc51..7bdf8fc645 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -7,8 +7,12 @@ using Content.Server.Ghost; using Content.Server.Popups; using Content.Server.PowerCell; using Content.Server.Traits.Assorted; +using Content.Shared._White.Item.DelayedKnockdown; using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Events; using Content.Shared.DoAfter; +using Content.Shared.Emag.Systems; using Content.Shared.Interaction; using Content.Shared.Interaction.Components; using Content.Shared.Interaction.Events; @@ -20,6 +24,8 @@ using Content.Shared.Mobs.Systems; using Content.Shared.PowerCell; using Content.Shared.Timing; using Content.Shared.Toggleable; +using Content.Shared.Weapons.Melee; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -54,8 +60,25 @@ public sealed class DefibrillatorSystem : EntitySystem SubscribeLocalEvent(OnPowerCellSlotEmpty); SubscribeLocalEvent(OnAfterInteract); SubscribeLocalEvent(OnDoAfter); + + SubscribeLocalEvent(OnStaminaHitAttempt); // WD } + // WD START + private void OnStaminaHitAttempt(Entity ent, ref StaminaDamageOnHitAttemptEvent args) + { + var (uid, comp) = ent; + if (comp.Enabled && _powerCell.TryUseActivatableCharge(uid)) + { + if (!_powerCell.HasActivatableCharge(uid)) + TryDisable(uid, comp); + return; + } + + args.Cancelled = true; + } + // WD END + private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args) { if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay))) @@ -159,8 +182,8 @@ public sealed class DefibrillatorSystem : EntitySystem if (!_powerCell.HasActivatableCharge(uid, user: user)) return false; - if (_mobState.IsAlive(target, mobState)) - return false; + // if (_mobState.IsAlive(target, mobState)) + // return false; return true; } @@ -177,6 +200,7 @@ public sealed class DefibrillatorSystem : EntitySystem return _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.DoAfterDuration, new DefibrillatorZapDoAfterEvent(), uid, target, uid) { + BreakOnMove = user == target, // WD EDIT BlockDuplicate = true, BreakOnHandChange = true, NeedHand = true @@ -206,7 +230,13 @@ public sealed class DefibrillatorSystem : EntitySystem ICommonSession? session = null; var dead = true; - if (_rotting.IsRotten(target)) + // WD EDIT START + var alive = false; + if (_mobState.IsAlive(target)) + { + alive = true; + } + else if (_rotting.IsRotten(target)) // WD EDIT END { _chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"), InGameICChatType.Speak, true); @@ -246,7 +276,7 @@ public sealed class DefibrillatorSystem : EntitySystem } } - var sound = dead || session == null + var sound = !alive && (dead || session == null) // WD EDIT ? component.FailureSound : component.SuccessSound; _audio.PlayPvs(sound, uid); diff --git a/Content.Shared/Medical/DefibrillatorComponent.cs b/Content.Shared/Medical/DefibrillatorComponent.cs index 2da5285285..ac7e9193ed 100644 --- a/Content.Shared/Medical/DefibrillatorComponent.cs +++ b/Content.Shared/Medical/DefibrillatorComponent.cs @@ -1,5 +1,6 @@ using Content.Shared.Damage; using Content.Shared.DoAfter; +using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; @@ -86,6 +87,10 @@ public sealed partial class DefibrillatorComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("readySound")] public SoundSpecifier? ReadySound = new SoundPathSpecifier("/Audio/Items/Defib/defib_ready.ogg"); + + // WD EDIT + [DataField] + public EntityWhitelist? EmaggedAttackWhitelist; } [Serializable, NetSerializable] diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index 217d9879c6..e5a8f5f58c 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -27,6 +27,7 @@ public sealed partial class MeleeWeaponComponent : Component /// [ViewVariables(VVAccess.ReadWrite)] [DataField] + [AutoNetworkedField] // WD EDIT public bool Hidden; /// @@ -75,10 +76,10 @@ public sealed partial class MeleeWeaponComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public bool CanMiss; - [DataField] + [DataField, AutoNetworkedField] public EntityWhitelist? AttackWhitelist; - [DataField] + [DataField, AutoNetworkedField] public EntityWhitelist? AttackBlacklist; [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] diff --git a/Content.Shared/_White/Item/DefibEmagSystem.cs b/Content.Shared/_White/Item/DefibEmagSystem.cs new file mode 100644 index 0000000000..716bfbe872 --- /dev/null +++ b/Content.Shared/_White/Item/DefibEmagSystem.cs @@ -0,0 +1,50 @@ +using Content.Shared._White.Item.DelayedKnockdown; +using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Emag.Systems; +using Content.Shared.Medical; +using Content.Shared.Weapons.Melee; +using Robust.Shared.Audio; + +namespace Content.Shared._White.Item; + +public sealed class DefibEmagSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnEmag); + } + + private void OnEmag(Entity ent, ref GotEmaggedEvent args) + { + var (uid, comp) = ent; + comp.ZapDamage = 55; + comp.ZapDelay = TimeSpan.FromSeconds(1); + comp.WritheDuration = TimeSpan.FromSeconds(6); + var meleeWeapon = new MeleeWeaponComponent + { + Hidden = true, + AttackRate = 0.2f, + CanHeavyAttack = false, + AttackWhitelist = comp.EmaggedAttackWhitelist, + EquipCooldown = 1f, + Damage = new DamageSpecifier() + }; + var delayedKnockdown = new DelayedKnockdownOnHitComponent + { + Delay = TimeSpan.Zero, + KnockdownTime = TimeSpan.FromSeconds(1.5) + }; + var staminaDamage = new StaminaDamageOnHitComponent + { + Damage = 60f, + Sound = new SoundCollectionSpecifier("sparks") + }; + AddComp(uid, meleeWeapon, true); + AddComp(uid, delayedKnockdown, true); + AddComp(uid, staminaDamage, true); + args.Handled = true; + } +} diff --git a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs index bee3baa40e..aeab3a49f4 100644 --- a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs +++ b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs @@ -26,6 +26,8 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem { var jitterTime = ent.Comp.JitterTime; var stutterTime = ent.Comp.StutterTime; + var delay = ent.Comp.Delay; + var knockdownTime = ent.Comp.KnockdownTime; foreach (var (uid, _) in args.HitList) { if (!TryComp(uid, out StatusEffectsComponent? statusEffects)) @@ -38,12 +40,17 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem _jitter.DoJitter(uid, jitterTime, true, status: statusEffects); if (stutterTime > TimeSpan.Zero) _stutter.DoStutter(uid, stutterTime, true, statusEffects); + if (delay <= TimeSpan.Zero) + { + _stun.TryKnockdown(uid, knockdownTime, true, statusEffects); + continue; + } if (HasComp(uid)) continue; var delayedKnockdown = EnsureComp(uid); - delayedKnockdown.KnockdownTime = TimeSpan.FromSeconds(Math.Max(ent.Comp.KnockdownTime.TotalSeconds, + delayedKnockdown.KnockdownTime = TimeSpan.FromSeconds(Math.Max(knockdownTime.TotalSeconds, delayedKnockdown.KnockdownTime.TotalSeconds)); - var knockdownMoment = _timing.CurTime + ent.Comp.Delay; + var knockdownMoment = _timing.CurTime + delay; if (knockdownMoment < delayedKnockdown.KnockdownMoment) delayedKnockdown.KnockdownMoment = knockdownMoment; } diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml index 4a61074a8d..5fb99e3cc9 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml @@ -35,6 +35,9 @@ zapHeal: types: Asphyxiation: -40 + emaggedAttackWhitelist: + components: + - Stamina - type: DoAfter - type: UseDelay - type: StaticPrice From 3e0b6ff57948c2228df087fcd6e91339472b9c8c Mon Sep 17 00:00:00 2001 From: RavmorganButOnCocaine Date: Mon, 5 Aug 2024 13:40:35 +0000 Subject: [PATCH 07/15] Automatic changelog update --- Resources/Changelog/ChangelogWhite.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Resources/Changelog/ChangelogWhite.yml b/Resources/Changelog/ChangelogWhite.yml index 6ad84b17ec..02e84d5eb5 100644 --- a/Resources/Changelog/ChangelogWhite.yml +++ b/Resources/Changelog/ChangelogWhite.yml @@ -7811,3 +7811,29 @@ id: 465 time: '2024-08-04T13:54:10.0000000+00:00' url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/562 +- author: Aviu + changes: + - message: "\u0414\u0435\u0444\u0438\u0431\u0430\u043C\u0438 \u043C\u043E\u0436\u043D\ + \u043E \u0442\u0435\u043F\u0435\u0440\u044C \u0431\u0438\u0442\u044C \u0436\u0438\ + \u0432\u044B\u0445." + type: Add + - message: "\u0414\u0435\u0444\u0438\u0431\u044B \u0442\u0435\u043F\u0435\u0440\u044C\ + \ \u043C\u043E\u0436\u043D\u043E \u0435\u043C\u0430\u0433\u043D\u0443\u0442\u044C\ + , \u044D\u0442\u043E \u0434\u0430\u0441\u0442 \u0438\u043C \u0432\u043E\u0437\ + \u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u0431\u0438\u0442\u044C \u0432\ + \ \u0431\u043E\u0435\u0432\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435\ + \ \u0440\u0430\u0437 \u0432 5 \u0441\u0435\u043A\u0443\u043D\u0434, \u043D\u0430\ + \u043D\u043E\u0441\u044F 60 \u0441\u0442\u0430\u043C\u0438\u043D\u044B \u0438\ + \ \u0440\u043E\u043D\u044F\u044F \u043D\u0430 \u043F\u043E\u043B \u043D\u0430\ + \ 1.5 \u0441\u0435\u043A\u0443\u043D\u0434\u044B. \u0422\u0430\u043A\u0436\u0435\ + \ \u0443\u0440\u043E\u043D \u043F\u0440\u0438 \u0443\u0434\u0430\u0440\u0435\ + \ \u0435\u043C\u0430\u0433\u043D\u0443\u0442\u044B\u043C \u0434\u0435\u0444\u0438\ + \u0431\u043E\u043C \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\ + \u0442\u0441\u044F \u0434\u043E 55, \u0432\u0440\u0435\u043C\u044F \u0441\u0442\ + \u0430\u043D\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\ + \u0442\u0441\u044F \u0434\u043E 6, \u0430 \u043A\u0434 \u0443\u043C\u0435\u043D\ + \u044C\u0448\u0430\u0435\u0442\u0441\u044F \u0434\u043E 1." + type: Add + id: 466 + time: '2024-08-05T13:39:31.0000000+00:00' + url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/567 From c719eb56e0bd03e536849c972d9998fb5e0fd1ad Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Mon, 5 Aug 2024 19:17:30 +0300 Subject: [PATCH 08/15] - tweak: Lightning and fireball. --- .../_White/Wizard/Magic/WizardSpellsSystem.cs | 4 ++++ Content.Shared/_White/Wizard/Magic/MagicComponent.cs | 6 +++++- Resources/Locale/ru-RU/_white/wizard/spells.ftl | 2 +- .../entities/clothing/outerclothing/armor.ftl | 4 ++-- .../Entities/Clothing/OuterClothing/armor.yml | 10 ++++++++-- Resources/Prototypes/Magic/white.yml | 8 +++++++- Resources/Prototypes/_White/tags.yml | 6 ++++++ 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs index 89c0ff1f2e..c696b82902 100644 --- a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs +++ b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs @@ -939,6 +939,10 @@ public sealed class WizardSpellsSystem : EntitySystem if (hasReqs) return; + if (_inventory.TryGetSlotEntity(args.Performer, "outerClothing", out var entity) && + comp.ClothingWhitelist?.IsValid(entity.Value) is true) + return; + args.Cancelled = true; _popupSystem.PopupEntity(Loc.GetString("magic-component-missing-req"), args.Performer, args.Performer); } diff --git a/Content.Shared/_White/Wizard/Magic/MagicComponent.cs b/Content.Shared/_White/Wizard/Magic/MagicComponent.cs index a43001ca53..7517d10ead 100644 --- a/Content.Shared/_White/Wizard/Magic/MagicComponent.cs +++ b/Content.Shared/_White/Wizard/Magic/MagicComponent.cs @@ -1,4 +1,5 @@ -using Robust.Shared.GameStates; +using Content.Shared.Whitelist; +using Robust.Shared.GameStates; namespace Content.Shared._White.Wizard.Magic; @@ -10,4 +11,7 @@ public sealed partial class MagicComponent : Component /// [DataField, ViewVariables(VVAccess.ReadWrite)] public bool RequiresClothes; + + [DataField] + public EntityWhitelist? ClothingWhitelist; } diff --git a/Resources/Locale/ru-RU/_white/wizard/spells.ftl b/Resources/Locale/ru-RU/_white/wizard/spells.ftl index 1f75497f0f..bba48bccdc 100644 --- a/Resources/Locale/ru-RU/_white/wizard/spells.ftl +++ b/Resources/Locale/ru-RU/_white/wizard/spells.ftl @@ -5,7 +5,7 @@ ent-ActionForceSpell = Сила .desc = Притягивает все объекты и сущности в указанную точку. Альтернативный каст: Прицельно притягивает к вам предмет или сущность. При зарядке: Вместо притяжение в выбранную точку, отталкивает все объекты от заклинателя. С каждым уровнем повышается мощность отталкивания. ent-ActionFireballSpell = Огненный шар - .desc = Создает огненный шар, наносящий огромный урон при взрыве. Альтернативный каст: Поджигает одну цель на любом расстоянии, навешивая проклятие, при котором смерть от огня уничтожит тело. При зарядке: Поджигает все сущности вокруг, с каждым уровнем повышается сила поджога и радиус поражения. + .desc = Создает огненный шар, наносящий огромный урон при взрыве. Альтернативный каст: Поджигает одну цель на любом расстоянии, навешивая проклятие, при котором смерть от огня уничтожит тело. При зарядке: Поджигает все сущности вокруг, с каждым уровнем повышается сила поджога и радиус поражения. Не работает без волшебной мантии и шляпы. ent-ActionCardSpell = Карты .desc = Настоящий козырь в рукаве! Вернее, целая колода таких. Выпускает несколько смертельных карт в одном направлении. Карты способны оглушить цель. Альтернативный каст: Превращает в карту любой предмет. В карту можно превратить только предметы. При зарядке: Выпускает карты вокруг вас, с каждым уровнем зарядки количество выпускаемых карт повышается. diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/clothing/outerclothing/armor.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/clothing/outerclothing/armor.ftl index b44670be46..48a4e9917b 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/clothing/outerclothing/armor.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/clothing/outerclothing/armor.ftl @@ -17,10 +17,10 @@ ent-ClothingOuterArmorHeavyRed = красный тяжелый бронекос .desc = Тяжело бронированный костюм с красными вставками, способный защитить от высокого урона. .suffix = { "" } ent-ClothingOuterArmorMagusblue = синие доспехи магуса - .desc = Синий бронекостюм, обеспечивающий хорошую защиту. Не обладает свойствами волшебной мантии. + .desc = Синий бронекостюм, обеспечивающий хорошую защиту. Не обладает свойствами волшебной мантии, но позволяет кастовать заклинание электрической дуги. .suffix = { "" } ent-ClothingOuterArmorMagusred = красные доспехи магуса - .desc = Красный бронекостюм, обеспечивающий хорошую защиту. Не обладает свойствами волшебной мантии. + .desc = Красный бронекостюм, обеспечивающий хорошую защиту. Не обладает свойствами волшебной мантии, но позволяет кастовать заклинание огненного шара. .suffix = { "" } ent-ClothingOuterArmorRiot = противоударный костюм .desc = Бронежилет с тяжелыми накладками для защиты в ближнем бою, идеально подходит для борьбы с правонарушителями на станции. diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml index bdf7e9fbd2..5eca9c6b41 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml @@ -222,6 +222,10 @@ - type: ClothingSpeedModifier walkModifier: 1 sprintModifier: 1 + - type: Tag + tags: + - WhitelistChameleon + - BlueMagusArmor - type: entity parent: ClothingOuterArmorMagusblue @@ -233,8 +237,10 @@ sprite: Clothing/OuterClothing/Armor/magusred.rsi - type: Clothing sprite: Clothing/OuterClothing/Armor/magusred.rsi - - + - type: Tag + tags: + - WhitelistChameleon + - RedMagusArmor - type: entity parent: ClothingOuterBase diff --git a/Resources/Prototypes/Magic/white.yml b/Resources/Prototypes/Magic/white.yml index a2cae1c89c..59f4b17ebb 100644 --- a/Resources/Prototypes/Magic/white.yml +++ b/Resources/Prototypes/Magic/white.yml @@ -5,6 +5,9 @@ components: - type: Magic requiresClothes: true + clothingWhitelist: + tags: + - BlueMagusArmor - type: WorldTargetAction itemIconStyle: BigAction useDelay: 60 @@ -72,7 +75,10 @@ noSpawn: true components: - type: Magic - requiresClothes: false + requiresClothes: true + clothingWhitelist: + tags: + - RedMagusArmor - type: WorldTargetAction itemIconStyle: BigAction useDelay: 60 diff --git a/Resources/Prototypes/_White/tags.yml b/Resources/Prototypes/_White/tags.yml index cec579ce37..2cb343cffe 100644 --- a/Resources/Prototypes/_White/tags.yml +++ b/Resources/Prototypes/_White/tags.yml @@ -93,3 +93,9 @@ - type: Tag id: UnoCard + +- type: Tag + id: RedMagusArmor + +- type: Tag + id: BlueMagusArmor From fc92514bfca8355b54fe123a1affc706e3db8dd3 Mon Sep 17 00:00:00 2001 From: drdth Date: Tue, 6 Aug 2024 10:02:15 +0300 Subject: [PATCH 09/15] fix --- Content.Server/IoC/ServerContentIoC.cs | 5 +++++ .../Players/PlayTimeTracking/PlayTimeTrackingManager.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Content.Server/IoC/ServerContentIoC.cs b/Content.Server/IoC/ServerContentIoC.cs index 59e49ac5c7..a494c25ad4 100644 --- a/Content.Server/IoC/ServerContentIoC.cs +++ b/Content.Server/IoC/ServerContentIoC.cs @@ -68,7 +68,12 @@ namespace Content.Server.IoC IoCManager.Register(); IoCManager.Register(); IoCManager.Register(); + +#if FULL_RELEASE IoCManager.Register(); +#else + IoCManager.Register(); +#endif // WD-EDIT IoCManager.Register(); diff --git a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs index 4d2b01f763..574ad33d34 100644 --- a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs +++ b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs @@ -54,7 +54,7 @@ public delegate void CalcPlayTimeTrackersCallback(ICommonSession player, HashSet /// Operations like refreshing and sending play time info to clients are deferred until the next frame (note: not tick). /// /// -public sealed class PlayTimeTrackingManager : ISharedPlaytimeManager +public sealed class PlayTimeTrackingManager : IPlayTimeTrackingManager, ISharedPlaytimeManager { [Dependency] private readonly IServerDbManager _db = default!; [Dependency] private readonly IServerNetManager _net = default!; From 64bbd61e56721f75d46da393693f218cc3a45274 Mon Sep 17 00:00:00 2001 From: drdth Date: Tue, 6 Aug 2024 10:22:08 +0300 Subject: [PATCH 10/15] revert 9999999999 minutes for loadout items --- Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml | 2 +- Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml | 4 ++-- Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml | 2 +- Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml | 2 +- .../Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml | 2 +- .../Loadouts/Jobs/Engineering/station_engineer.yml | 6 +++--- .../Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml | 6 +++--- Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml | 2 +- .../Prototypes/Loadouts/Jobs/Security/security_officer.yml | 4 ++-- Resources/Prototypes/Loadouts/Jobs/common.yml | 2 +- Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml b/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml index b9a0aa97fe..932b5ee9a2 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobSalvageSpecialist - time: 9999999999 # 15 hours 54000 + time: 54000 # 15 hours # Head diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml index e94fed5b3c..1f89080c39 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobClown - time: 9999999999 # 30 hours as clown required to ascend 108000 + time: 108000 # 30 hours as clown required to ascend - type: loadoutEffectGroup # WD id: MedalClownTimer @@ -15,7 +15,7 @@ requirement: !type:RoleTimeRequirement role: JobClown - time: 9999999999 # 10 hours 36000 + time: 36000 # 10 hours # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml index f995a72b70..368d858a16 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobJanitor - time: 9999999999 # 10 hours 36000 + time: 36000 # 10 hours # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml index 8df0b89256..857dd7bf17 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobPassenger - time: 9999999999 #10 hrs, silly reward for people who play passenger a lot 36000 + time: 36000 #10 hrs, silly reward for people who play passenger a lot # Face - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml b/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml index a940661750..506c8ce58e 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobHeadOfPersonnel - time: 9999999999 #15 hrs, special reward for HoP mains 54000 + time: 54000 #15 hrs, special reward for HoP mains # Jumpsuit - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml index 08edb8e587..32fc991bea 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml @@ -6,17 +6,17 @@ requirement: !type:RoleTimeRequirement role: JobAtmosphericTechnician - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:RoleTimeRequirement role: JobStationEngineer - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Engineering - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml index c83c422cfb..6756d37cd9 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml @@ -6,17 +6,17 @@ requirement: !type:RoleTimeRequirement role: JobChemist - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:RoleTimeRequirement role: JobMedicalDoctor - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Medical - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml b/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml index d8a95edd29..4e56a46d46 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml @@ -6,7 +6,7 @@ requirement: !type:DepartmentTimeRequirement department: Science - time: 9999999999 #60 hrs 216000 + time: 216000 #60 hrs # Head diff --git a/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml b/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml index e534eee5ef..57a1f7c1ab 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml @@ -6,12 +6,12 @@ requirement: !type:RoleTimeRequirement role: JobWarden - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Security - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/common.yml b/Resources/Prototypes/Loadouts/Jobs/common.yml index 0bbaaa78bb..b51c76a769 100644 --- a/Resources/Prototypes/Loadouts/Jobs/common.yml +++ b/Resources/Prototypes/Loadouts/Jobs/common.yml @@ -7,7 +7,7 @@ requirement: !type:RoleTimeRequirement role: JobPassenger - time: 9999999999 # 50 hours 180000 + time: 180000 # 50 hours # Eyes diff --git a/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml b/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml index 9632006cec..7366152074 100644 --- a/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml +++ b/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobLibrarian - time: 9999999999 # 1 hour of being the biggest nerd on the station 3600 + time: 3600 # 1 hour of being the biggest nerd on the station - type: loadoutEffectGroup id: JensenTimer @@ -15,7 +15,7 @@ requirement: !type:DepartmentTimeRequirement department: Cargo - time: 9999999999 #5 hours of being a space trucker 18000 + time: 18000 #5 hours of being a space trucker # Basic options # Glasses From 6a384246b886556032f825377d869ad963e723c7 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 6 Aug 2024 10:30:40 +0300 Subject: [PATCH 11/15] - tweak: Nerf cult shield. --- .../Prototypes/_White/Entities/Cult/Items/forge_craft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml b/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml index da5ae47d31..c1a210e6da 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml @@ -23,12 +23,12 @@ thresholds: - trigger: !type:DamageTrigger - damage: 150 + damage: 100 behaviors: - !type:DoActsBehavior acts: [ "Destruction" ] - type: Reflect - reflectProb: 0.5 + reflectProb: 0.25 reflects: - Energy - type: ReturnItemOnThrow From 27e7f25f7e0748c8d676678cb34322fb630f26c5 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 6 Aug 2024 10:32:32 +0300 Subject: [PATCH 12/15] - fix: No visible aghost. --- Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index c7713a6628..5a30873846 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -101,6 +101,7 @@ - Biological - Inorganic - type: Invisibility + - type: ThermalBlocker - type: entity id: ActionAGhostShowSolar From d023d29e54b48dc56dc782ba5c9c57872aef1bab Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:58:30 +0300 Subject: [PATCH 13/15] =?UTF-8?q?=D0=A1=D0=BE=D0=BE=D0=B1=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=9F=D0=94=D0=90=20(#564)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: Сообщения в ПДА * Search bar and colors in messages on the PDA --- Content.Client/PDA/PdaMenu.xaml.cs | 14 +- .../CartridgeLoader/Cartridges/MessagesUi.cs | 38 +++ .../Cartridges/MessagesUiFragment.cs | 129 ++++++++ .../Cartridges/MessagesUiFragment.xaml | 17 + .../Systems/SingletonDeviceNetServerSystem.cs | 2 +- Content.Server/Mind/Commands/RenameCommand.cs | 2 +- Content.Server/PDA/PdaSystem.cs | 16 +- .../Station/Systems/StationSpawningSystem.cs | 11 +- .../Cartridges/MessagesCartridgeComponent.cs | 20 ++ .../Cartridges/MessagesCartridgeSystem.cs | 290 ++++++++++++++++++ .../RandomHumanSystem/RandomHumanSystem.cs | 2 +- .../Components/MessagesServerComponent.cs | 26 ++ .../EntitySystems/MessagesServerSystem.cs | 128 ++++++++ Content.Shared/PDA/PdaComponent.cs | 3 + Content.Shared/PDA/PdaUpdateState.cs | 1 + .../Cartridges/MessagesUiMessageEvent.cs | 26 ++ .../Cartridges/MessagesUiState.cs | 47 +++ .../en-US/cartridge-loader/cartridges.ftl | 1 + .../en-US/radio/components/pda-messages.ftl | 9 + .../ru-RU/cartridge-loader/cartridges.ftl | 1 + Resources/Locale/ru-RU/pda/pda-component.ftl | 2 +- .../ru-RU/radio/components/pda-messages.ftl | 9 + .../entities/objects/devices/cartridges.ftl | 6 + .../structures/machines/telecomms.ftl | 4 + .../Device/devicenet_frequencies.yml | 20 ++ .../Entities/Objects/Devices/cartridges.yml | 48 +++ .../Entities/Objects/Devices/pda.yml | 4 + .../Structures/Machines/telecomms.yml | 66 ++++ 28 files changed, 929 insertions(+), 13 deletions(-) create mode 100644 Content.Client/_White/CartridgeLoader/Cartridges/MessagesUi.cs create mode 100644 Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.cs create mode 100644 Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.xaml create mode 100644 Content.Server/_White/CartridgeLoader/Cartridges/MessagesCartridgeComponent.cs create mode 100644 Content.Server/_White/CartridgeLoader/Cartridges/MessagesCartridgeSystem.cs create mode 100644 Content.Server/_White/Radio/Components/MessagesServerComponent.cs create mode 100644 Content.Server/_White/Radio/EntitySystems/MessagesServerSystem.cs create mode 100644 Content.Shared/_White/CartridgeLoader/Cartridges/MessagesUiMessageEvent.cs create mode 100644 Content.Shared/_White/CartridgeLoader/Cartridges/MessagesUiState.cs create mode 100644 Resources/Locale/en-US/radio/components/pda-messages.ftl create mode 100644 Resources/Locale/ru-RU/radio/components/pda-messages.ftl create mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/entities/structures/machines/telecomms.ftl diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 630861d084..c62acd0fc5 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -26,13 +26,13 @@ namespace Content.Client.PDA public const int ProgramContentView = 3; - private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); + private string _pdaOwnerName = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); private string _stationName = Loc.GetString("comp-pda-ui-unknown"); private string _alertLevel = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); - + private int _currentView; @@ -96,7 +96,7 @@ namespace Content.Client.PDA PdaOwnerButton.OnPressed += _ => { - _clipboard.SetText(_pdaOwner); + _clipboard.SetText(_pdaOwnerName); }; IdInfoButton.OnPressed += _ => @@ -125,7 +125,7 @@ namespace Content.Client.PDA _clipboard.SetText(_instructions); }; - + HideAllViews(); @@ -138,9 +138,9 @@ namespace Content.Client.PDA if (state.PdaOwnerInfo.ActualOwnerName != null) { - _pdaOwner = state.PdaOwnerInfo.ActualOwnerName; + _pdaOwnerName = state.PdaOwnerInfo.ActualOwnerName; PdaOwnerLabel.SetMarkup(Loc.GetString("comp-pda-ui-owner", - ("actualOwnerName", _pdaOwner))); + ("actualOwnerName", _pdaOwnerName))); } @@ -160,7 +160,7 @@ namespace Content.Client.PDA _stationName = state.StationName ?? Loc.GetString("comp-pda-ui-unknown"); StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station", ("station", _stationName))); - + var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); diff --git a/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUi.cs b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUi.cs new file mode 100644 index 0000000000..7dcb845527 --- /dev/null +++ b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUi.cs @@ -0,0 +1,38 @@ +using Content.Client.UserInterface.Fragments; +using Content.Shared._White.CartridgeLoader.Cartridges; +using Content.Shared.CartridgeLoader; +using Robust.Client.UserInterface; + +namespace Content.Client._White.CartridgeLoader.Cartridges; + +public sealed partial class MessagesUi : UIFragment +{ + private MessagesUiFragment _fragment; + + public override Control GetUIFragmentRoot() + { + return _fragment; + } + + public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner) + { + _fragment = new MessagesUiFragment(); + _fragment.OnMessageSent += note => SendMessagesMessage(MessagesUiAction.Send, note, null, userInterface); + _fragment.OnButtonPressed += userUid => SendMessagesMessage(MessagesUiAction.ChangeChat, null, userUid, userInterface); + } + + public override void UpdateState(BoundUserInterfaceState state) + { + if (state is not MessagesUiState messagesState) + return; + + _fragment.UpdateState(messagesState.Mode, messagesState.Contents, messagesState.Name); + } + + private void SendMessagesMessage(MessagesUiAction action, string? stringInput, int? uidInput, BoundUserInterface userInterface) + { + var messagesMessage = new MessagesUiMessageEvent(action, stringInput, uidInput); + var message = new CartridgeUiMessage(messagesMessage); + userInterface.SendMessage(message); + } +} diff --git a/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.cs b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.cs new file mode 100644 index 0000000000..dbadc56078 --- /dev/null +++ b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.cs @@ -0,0 +1,129 @@ +using System.Numerics; +using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Content.Shared._White.CartridgeLoader.Cartridges; +using Content.Shared.Roles; +using Robust.Shared.Prototypes; + +namespace Content.Client._White.CartridgeLoader.Cartridges; + +[GenerateTypedNameReferences] +public sealed partial class MessagesUiFragment : BoxContainer +{ + public event Action? OnMessageSent; + public event Action? OnButtonPressed; + + private string _searchText = string.Empty; + + public MessagesUiFragment() + { + RobustXamlLoader.Load(this); + Input.OnTextEntered += _ => + { + if (!string.IsNullOrEmpty(Input.Text)) + OnMessageSent?.Invoke(Input.Text); + Input.Clear(); + }; + + BackButton.OnPressed += _ => OnButtonPressed?.Invoke(null); + SearchBar.OnTextChanged += OnSearchTextChanged; + + UpdateState(MessagesUiStateMode.UserList, [], null); + } + + public void UpdateState(MessagesUiStateMode mode, List<(MessagesUser, int?)>? contents, string? name) + { + MessageContainer.DisposeAllChildren(); + Input.Orphan(); + BackButton.Orphan(); + + SearchBar.Visible = false; + + if (contents == null) + return; + + if (mode == MessagesUiStateMode.Chat) + { + HeaderLabel.Text = name; + + foreach (var (senderName, message) in contents) + { + AddNote($"{senderName.Name} {message}"); + } + + OverContainer.AddChild(Input); + HeaderBox.AddChild(BackButton); + BackButton.SetPositionInParent(0); + } + else if (mode == MessagesUiStateMode.Error) + { + HeaderLabel.Text = Loc.GetString("messages-pda-error-header"); + AddNote(Loc.GetString("messages-pda-error-message")); + } + else + { + SearchBar.Visible = true; + HeaderLabel.Text = Loc.GetString("messages-pda-chat-choice"); + foreach (var (messagesUser, userUid) in contents) + { + AddButton(userUid, messagesUser.Name + ", " + messagesUser.Job, messagesUser.Department); + } + } + } + + /// + /// Adding a button for selecting a chat + /// + private void AddButton(int? userUid, string userName, string departmentId) + { + var styleClass = IoCManager.Resolve().Index(departmentId).ButtonStyle; + + var button = new Button + { + Text = userName, + HorizontalExpand = true, + ClipText = true, + StyleClasses = { styleClass }, + MinWidth = 60 + }; + button.OnPressed += _ => OnButtonPressed?.Invoke(userUid); + MessageContainer.AddChild(button); + } + + /// + /// Adding a text label to the message container + /// + private void AddNote(string note) + { + MessageContainer.AddChild(new Label + { + Text = note, + HorizontalExpand = true, + ClipText = false + }); + } + + private bool ButtonIsVisible(Button button) + { + return string.IsNullOrEmpty(_searchText) || button.Text == null || button.Text.Contains(_searchText, StringComparison.OrdinalIgnoreCase); + } + + private void UpdateVisibleButtons() + { + foreach (var child in MessageContainer.Children) + { + if (child is Button button) + button.Visible = ButtonIsVisible(button); + } + } + + private void OnSearchTextChanged(LineEdit.LineEditEventArgs args) + { + _searchText = args.Text; + + UpdateVisibleButtons(); + // Reset scroll bar so they can see the relevant results. + MessagesScroll.SetScrollValue(Vector2.Zero); + } +} diff --git a/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.xaml b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.xaml new file mode 100644 index 0000000000..2871d8693b --- /dev/null +++ b/Content.Client/_White/CartridgeLoader/Cartridges/MessagesUiFragment.xaml @@ -0,0 +1,17 @@ + + + + +