-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- ЭТО ШАБЛОН ВАШЕГО PULL REQUEST. Текст между стрелками - это комментарии - они не будут видны в PR. --> ## Описание PR <!-- Ниже опишите ваш Pull Request. Что он изменяет? На что еще это может повлиять? Постарайтесь описать все внесённые вами изменения! --> Дело было вечером, делать было нечего... Собственно, я реализовал свою давнюю задумку. Положительные черты персонажей, а не только негативные. **Медиа** <!-- Если приемлемо, добавьте скриншоты для демонстрации вашего PR. Если ваш PR представляет собой визуальное изменение, добавьте скриншоты, иначе он может быть закрыт. --> ![image](https://github.com/user-attachments/assets/e50da604-d95e-483f-b43d-4b98ac06dff9) **Проверки** <!-- Выполнение всех следующих действий, если это приемлемо для вида изменений сильно ускорит разбор вашего PR --> - [ ] PR полностью завершён и мне не нужна помощь чтобы его закончить. - [x] Я внимательно просмотрел все свои изменения и багов в них не нашёл. - [x] Я запускал локальный сервер со своими изменениями и всё протестировал. - [x] Я добавил скриншот/видео демонстрации PR в игре, **или** этот PR этого не требует. **Изменения** <!-- Здесь вы можете написать список изменений, который будет автоматически добавлен в игру, когда ваш PR будет принят. В журнал изменений следует помещать только то, что действительно важно игрокам. В списке изменений тип значка не является часть предложения, поэтому явно указывайте - Добавлен, Удалён, Изменён. плохо: - add: Новый инструмент для инженеров хорошо: - add: Добавлен новый инструмент для инженеров Вы можете указать своё имя после символа 🆑 именно оно будет отображаться в журнале изменений (иначе будет использоваться ваше имя на GitHub) Например: 🆑 Ian --> 🆑 Котя - add: Переведены черты персонажа на систему поинтов. - add: Добавлена черты "Ловкий". Она позволяет быстро забираться в шкафы без необходимости открывать их. - add: Добавлена черты "Осторожный шаг". Она позволяет не получать урон, проходя по осколкам без обуви. - add: Добавлена черты "Спринтер". Она слегка увеличивает скорость персонажа. - add: Добавлена черты "Сильный бросок". Она усиливает броски предметов. - add: Добавлена черты "Паркурщик". Она позволяет быстро забираться на столы. --------- Co-authored-by: Schrödinger <[email protected]> Co-authored-by: 1Stepka1 <[email protected]>
- Loading branch information
1 parent
f462bb0
commit 718f0f5
Showing
23 changed files
with
347 additions
and
14 deletions.
There are no files selected for viewing
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,46 @@ | ||
using Content.Shared.ADT.Traits; | ||
using Content.Client.Storage.Components; | ||
using Content.Shared.Storage.EntitySystems; | ||
using Content.Shared.Verbs; | ||
using Content.Shared.Tools.Components; | ||
using Content.Shared.Whitelist; | ||
using Content.Shared.Lock; | ||
|
||
namespace Content.Client.ADT.Traits; | ||
|
||
public sealed class QuirksSystem : SharedQuirksSystem | ||
{ | ||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<EntityStorageComponent, GetVerbsEvent<AlternativeVerb>>(OnGetHideVerbs); | ||
|
||
} | ||
|
||
private void OnGetHideVerbs(EntityUid uid, EntityStorageComponent comp, GetVerbsEvent<AlternativeVerb> args) | ||
{ | ||
if (!args.CanAccess || !args.CanInteract) | ||
return; | ||
|
||
if (!HasComp<FastLockersComponent>(args.User)) | ||
return; | ||
if (TryComp<WeldableComponent>(uid, out var weldable) && weldable.IsWelded) | ||
return; | ||
if (_whitelist.IsWhitelistFail(comp.Whitelist, args.User)) | ||
return; | ||
if (TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked) | ||
return; | ||
|
||
AlternativeVerb verb = new() | ||
{ | ||
Act = () => TryHide(args.User, uid), | ||
Text = Loc.GetString("quirk-fast-locker-hide-verb"), | ||
}; | ||
args.Verbs.Add(verb); | ||
|
||
} | ||
|
||
} |
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,46 @@ | ||
using Content.Shared.ADT.Traits; | ||
using Content.Server.Storage.Components; | ||
using Content.Shared.Storage.EntitySystems; | ||
using Content.Shared.Verbs; | ||
using Content.Shared.Tools.Components; | ||
using Content.Shared.Whitelist; | ||
using Content.Shared.Lock; | ||
|
||
namespace Content.Server.ADT.Traits; | ||
|
||
public sealed class QuirksSystem : SharedQuirksSystem | ||
{ | ||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<EntityStorageComponent, GetVerbsEvent<AlternativeVerb>>(OnGetHideVerbs); | ||
|
||
} | ||
|
||
private void OnGetHideVerbs(EntityUid uid, EntityStorageComponent comp, GetVerbsEvent<AlternativeVerb> args) | ||
{ | ||
if (!args.CanAccess || !args.CanInteract) | ||
return; | ||
|
||
if (!HasComp<FastLockersComponent>(args.User)) | ||
return; | ||
if (TryComp<WeldableComponent>(uid, out var weldable) && weldable.IsWelded) | ||
return; | ||
|
||
if (_whitelist.IsWhitelistFail(comp.Whitelist, args.User)) | ||
return; | ||
if (TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked) | ||
return; | ||
|
||
AlternativeVerb verb = new() | ||
{ | ||
Act = () => TryHide(args.User, uid), | ||
Text = Loc.GetString("quirk-fast-locker-hide-verb"), | ||
}; | ||
args.Verbs.Add(verb); | ||
|
||
} | ||
|
||
} |
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,9 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class FastLockersComponent : Component | ||
{ | ||
} |
14 changes: 14 additions & 0 deletions
14
Content.Shared/ADT/Quirks/Components/FreerunningComponent.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,14 @@ | ||
using Content.Shared.Tag; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class FreerunningComponent : Component | ||
{ | ||
[DataField] | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float Modifier = 0.6f; | ||
} |
14 changes: 14 additions & 0 deletions
14
Content.Shared/ADT/Quirks/Components/HardThrowerComponent.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,14 @@ | ||
using Content.Shared.Tag; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class HardThrowerComponent : Component | ||
{ | ||
[DataField] | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float Modifier = 0.8f; | ||
} |
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,11 @@ | ||
using Content.Shared.Tag; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class SoftWalkComponent : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Content.Shared.Tag; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class SprinterComponent : Component | ||
{ | ||
[DataField] | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float Modifier = 1.1f; | ||
} |
69 changes: 69 additions & 0 deletions
69
Content.Shared/ADT/Quirks/EntitySystems/SharedQuirksSystem.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,69 @@ | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Random; | ||
using Content.Shared.Climbing.Events; | ||
using Robust.Shared.Network; | ||
using Content.Shared.Throwing; | ||
using Content.Shared.Verbs; | ||
using Content.Shared.Tools.Components; | ||
using Content.Shared.StepTrigger.Systems; | ||
using Content.Shared.Storage.EntitySystems; | ||
using Content.Shared.Popups; | ||
using Content.Shared.Tag; | ||
using Content.Shared.Movement.Components; | ||
using Content.Shared.Movement.Systems; | ||
using Content.Shared.StepTrigger.Components; | ||
|
||
namespace Content.Shared.ADT.Traits; | ||
|
||
public abstract class SharedQuirksSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedEntityStorageSystem _storage = default!; | ||
[Dependency] protected readonly IRobustRandom _random = default!; | ||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!; | ||
[Dependency] private readonly SharedPopupSystem _popup = default!; | ||
[Dependency] private readonly TagSystem _tag = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<FreerunningComponent, CheckClimbSpeedModifiersEvent>(OnFreerunningClimbTimeModify); | ||
|
||
SubscribeLocalEvent<SprinterComponent, MapInitEvent>(OnSprinterMapInit); | ||
SubscribeLocalEvent<SprinterComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed); | ||
|
||
SubscribeLocalEvent<HardThrowerComponent, CheckThrowRangeModifiersEvent>(OnThrowerRangeModify); | ||
} | ||
|
||
public void TryHide(EntityUid uid, EntityUid closet) | ||
{ | ||
if (_storage.Insert(uid, closet)) | ||
{ | ||
_popup.PopupClient(Loc.GetString("quirk-fast-locker-hide-success"), uid); | ||
} | ||
else | ||
_popup.PopupCursor(Loc.GetString("quirk-fast-locker-hide-fail"), uid); | ||
} | ||
|
||
private void OnFreerunningClimbTimeModify(EntityUid uid, FreerunningComponent comp, ref CheckClimbSpeedModifiersEvent args) | ||
{ | ||
if (args.User == args.Climber) | ||
args.Time *= comp.Modifier; | ||
} | ||
|
||
private void OnSprinterMapInit(EntityUid uid, SprinterComponent comp, MapInitEvent args) | ||
{ | ||
if (!TryComp<MovementSpeedModifierComponent>(uid, out var move)) | ||
return; | ||
_movementSpeed.RefreshMovementSpeedModifiers(uid, move); | ||
} | ||
private void OnRefreshMovespeed(EntityUid uid, SprinterComponent component, RefreshMovementSpeedModifiersEvent args) | ||
{ | ||
args.ModifySpeed(1f, component.Modifier); | ||
} | ||
|
||
private void OnThrowerRangeModify(EntityUid uid, HardThrowerComponent component, ref CheckThrowRangeModifiersEvent args) | ||
{ | ||
args.SpeedMod = component.Modifier; | ||
args.VectorMod = component.Modifier; | ||
} | ||
|
||
} |
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,6 @@ | ||
namespace Content.Shared.Climbing.Events; // ADT File | ||
|
||
[ByRefEvent] | ||
public record struct CheckClimbSpeedModifiersEvent(EntityUid User, EntityUid Climber, EntityUid Climbable, float Time) | ||
{ | ||
} |
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
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,9 @@ | ||
using System.Numerics; // ADT File | ||
|
||
namespace Content.Shared.Throwing; | ||
|
||
/// <summary> | ||
/// Raised on thrown entity. | ||
/// </summary> | ||
[ByRefEvent] | ||
public record struct CheckThrowRangeModifiersEvent(EntityUid? User, float VectorMod = 1f, float SpeedMod = 1f); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
quirk-fast-locker-hide-success = Вы успешно спрятались. | ||
quirk-fast-locker-hide-fail = Вы не можете забраться сюда. | ||
quirk-fast-locker-hide-verb = Спрятаться |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
trait-category-height = Рост | ||
trait-category-quirks = Особенности | ||
trait-category-height = Рост | ||
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,14 @@ | ||
trait-soft-walk-name = Осторожный шаг | ||
trait-soft-walk-desc = Вы достаточно осторожны, чтобы не наступать на опасные точки даже без обуви. | ||
trait-freerunning-name = Паркурщик | ||
trait-freerunning-desc = Вы гораздо быстрее забираетесь на столы. | ||
trait-sprinter-name = Спринтер | ||
trait-sprinter-desc = Вы бегаете чуть быстрее остальных представителей своего вида. | ||
trait-fast-lockers-name = Ловкий | ||
trait-fast-lockers-desc = Вы можете моментально и максимально незаметно забраться внутрь шкафа, или ящика. | ||
trait-hard-thrower-name = Сильный бросок | ||
trait-hard-thrower-desc = Вы бросаетесь вещами сильнее остальных. |
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
Oops, something went wrong.