Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 3 #5

Merged
merged 22 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Events;
using Content.Shared.Examine;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.ADT.SwitchableWeapon;

Check failure on line 6 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeapon' does not exist in the namespace 'Content.Shared.ADT' (are you missing an assembly reference?)

Check failure on line 6 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The type or namespace name 'SwitchableWeapon' does not exist in the namespace 'Content.Shared.ADT' (are you missing an assembly reference?)

Check failure on line 6 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The type or namespace name 'SwitchableWeapon' does not exist in the namespace 'Content.Shared.ADT' (are you missing an assembly reference?)

Check failure on line 6 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeapon' does not exist in the namespace 'Content.Shared.ADT' (are you missing an assembly reference?)
using Content.Shared.Toggleable;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio.Systems;

namespace Content.Server.ADT.SwitchableWeapon;

public sealed class SwitchableWeaponSystem : EntitySystem

Check failure on line 13 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The namespace 'Content.Server.ADT.SwitchableWeapon' already contains a definition for 'SwitchableWeaponSystem'

Check failure on line 13 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The namespace 'Content.Server.ADT.SwitchableWeapon' already contains a definition for 'SwitchableWeaponSystem'

Check failure on line 13 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The namespace 'Content.Server.ADT.SwitchableWeapon' already contains a definition for 'SwitchableWeaponSystem'

Check failure on line 13 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The namespace 'Content.Server.ADT.SwitchableWeapon' already contains a definition for 'SwitchableWeaponSystem'
{
[Dependency] private readonly SharedItemSystem _item = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SwitchableWeaponComponent, UseInHandEvent>(Toggle);
SubscribeLocalEvent<SwitchableWeaponComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<SwitchableWeaponComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<SwitchableWeaponComponent, GetMeleeDamageEvent>(OnGetMeleeDamage);
SubscribeLocalEvent<SwitchableWeaponComponent, ComponentAdd>(OnComponentAdded);
}

private void OnComponentAdded(EntityUid uid, SwitchableWeaponComponent component, ComponentAdd args)

Check failure on line 30 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 30 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 30 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 30 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)
{
UpdateState(uid, component);
}

//Non-stamina damage
private void OnGetMeleeDamage(EntityUid uid, SwitchableWeaponComponent component, ref GetMeleeDamageEvent args)

Check failure on line 36 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 36 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)
{
args.Damage = component.IsOpen ? component.DamageOpen : component.DamageFolded;
}

private void OnStaminaHitAttempt(EntityUid uid, SwitchableWeaponComponent component, ref StaminaDamageOnHitAttemptEvent args)

Check failure on line 41 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 41 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 41 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 41 in Content.Server/ADT/SwitchableWeapon/SwitchableWeaponSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'SwitchableWeaponComponent' could not be found (are you missing a using directive or an assembly reference?)
{
if (!component.IsOpen)
return;

//args.HitSoundOverride = component.BonkSound;
}

private void OnExamined(EntityUid uid, SwitchableWeaponComponent comp, ExaminedEvent args)
{
var msg = comp.IsOpen
? Loc.GetString("comp-switchable-examined-on")
: Loc.GetString("comp-switchable-examined-off");
args.PushMarkup(msg);
}

private void UpdateState(EntityUid uid, SwitchableWeaponComponent comp)
{
if (TryComp<ItemComponent>(comp.Owner, out var item))
{
_item.SetSize(item.Owner, comp.IsOpen ? comp.SizeOpened : comp.SizeClosed, item);
_item.SetHeldPrefix(comp.Owner, comp.IsOpen ? "on" : "off", false, item);
}

if (TryComp<AppearanceComponent>(comp.Owner, out var appearance))
_appearance.SetData(comp.Owner, ToggleVisuals.Toggled, comp.IsOpen, appearance);

// Change stamina damage according to state
if (TryComp<StaminaDamageOnHitComponent>(uid, out var stamComp))
{
stamComp.Damage = comp.IsOpen ? comp.StaminaDamageOpen : comp.StaminaDamageFolded;
}
}

private void Toggle(EntityUid uid, SwitchableWeaponComponent comp, UseInHandEvent args)
{
comp.IsOpen = !comp.IsOpen;
UpdateState(uid, comp);

var soundToPlay = comp.IsOpen ? comp.OpenSound : comp.CloseSound;
_audio.PlayPvs(soundToPlay, args.User);
}
}
51 changes: 0 additions & 51 deletions Content.Shared/ADT/SwitchableWeapon/SwitchableWeaponComponent.cs
Original file line number Diff line number Diff line change
@@ -1,51 +0,0 @@

using Content.Shared.Damage;
using Content.Shared.Item;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;

namespace Content.Shared.ADT.SwitchableWeapon;

[RegisterComponent]
public sealed partial class SwitchableWeaponComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)][DataField("damageFolded")]
public DamageSpecifier DamageFolded = new(){
DamageDict = new()
{
{ "Blunt", 0.0f },
}
};

[ViewVariables(VVAccess.ReadWrite)][DataField("damageOpen")]
public DamageSpecifier DamageOpen = new(){
DamageDict = new()
{
{ "Blunt", 4.0f },
}
};

[ViewVariables(VVAccess.ReadWrite)][DataField("staminaDamageFolded")]
public float StaminaDamageFolded = 0;

[ViewVariables(VVAccess.ReadWrite)][DataField("staminaDamageOpen")]
public float StaminaDamageOpen = 28;

[ViewVariables(VVAccess.ReadWrite)][DataField("isOpen")]
public bool IsOpen = false;

[ViewVariables(VVAccess.ReadWrite)][DataField("openSound")]
public SoundSpecifier? OpenSound;

[ViewVariables(VVAccess.ReadWrite)][DataField("closeSound")]
public SoundSpecifier? CloseSound;

[ViewVariables(VVAccess.ReadWrite)][DataField("bonkSound")]
public SoundSpecifier? BonkSound;

[ViewVariables(VVAccess.ReadWrite)][DataField("sizeOpened")]
public ProtoId<ItemSizePrototype> SizeOpened = "Normal";

[ViewVariables(VVAccess.ReadWrite)][DataField("sizeClosed")]
public ProtoId<ItemSizePrototype> SizeClosed = "Normal";
}
Binary file added Resources/Audio/ADT/close_telescopichka.ogg
Binary file not shown.
Binary file added Resources/Audio/ADT/open_telescopichka.ogg
Binary file not shown.
3 changes: 3 additions & 0 deletions Resources/Locale/ru-RU/ADT/Entities/Clothing/Belt/belt.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ADTClothingBeltInvestigatorHolster = кобура следователя СБ
.desc = Кобура с табельным оружием следователя СБ - пистолетом с магазинами нелетальных и летальных патронов.
.suffix = { "" }
3 changes: 3 additions & 0 deletions Resources/Locale/ru-RU/ADT/Entities/Clothing/Head/hats.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ADTClothingHeadHatsInvestigatorCap = фуражка следователя Службы Безопасности
.desc = Слава NanoTrasen!
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ADTClothingNeckSecBadge = жетон Службы Безопасности
.desc = Позолоченный жетон с символикой Службы Безопасности и индивидуальным номером сотрудника. Предмет особой гордости среди офицеров.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ADTClothingOuterCoatInvestigator = бушлат следователя Службы Безопасности
.desc = Один вид этого бушлата повышает вероятность чистосердечного признания подозреваемого на 50%.
.suffix = { "" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ADTClothingUniformInvestigatorSuit = форма следователя Службы Безопасности
.desc = Одежда для того, кто намерен докопаться до сути всех тайн.
.suffix = { "" }
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/ADT/Entities/Objects/Device/pda.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ADTInvestigatorPDA = КПК следователя СБ
.desc = Пахнет как чернила и дело, закрытое предварительно из-за смерти подозреваемого от несчастного случая на рабочем месте.
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
ent-ADTPathologistIDCard = ID карта патологоанатома
.desc = { ent-IDCardStandard.desc }

ent-ADTRoboticistIDCard = ID карта робототехника
.desc = { ent-IDCardStandard.desc }
11 changes: 11 additions & 0 deletions Resources/Locale/ru-RU/ADT/Entities/Weapons/security.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ent-ADTtelescopicBaton = Телескопическая дубинка
.desc = "Большая, опасная и выдвижная дубинка. Может храниться в карманах в сложенном состоянии."
.suffix = { "" }

ent-ADTtelescopicBatonBob = Телескопическая дубинка Боба
.desc = "Эксклюзивная телескопическая дубинка, полностью из золота."
.suffix = { "" }

ent-ADTtelescopicBatonKon = Телескопическая дубинка Йохана
.desc = "Непонятно, кровь это или цвет дубинки.."
.suffix = { "" }
3 changes: 0 additions & 3 deletions Resources/Locale/ru-RU/ADT/Job/job-description.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
job-description-ADTPathologist = Осматривайте тела мёртвого экипажа, выявляйте причины их смерти и не забывайте клонировать трупы.

job-description-roboticist = Собирайте боргов, мехов, обслуживайте синтетиков и поражайте (либо пугайте) экипаж своими новейшими разработками.
5 changes: 0 additions & 5 deletions Resources/Locale/ru-RU/ADT/Job/job-names.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
job-name-ADTPathologist = Патологоанатом
JobADTPathologist = Патологоанатом

job-name-roboticist = робототехник
JobRoboticist = робототехник
11 changes: 11 additions & 0 deletions Resources/Prototypes/ADT/Catalog/Fills/Items/belt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#кобура следователя СБ

- type: entity
id: ADTClothingBeltInvestigatorHolster
parent: ClothingBeltHolster
suffix: Filled
components:
- type: StorageFill
contents:
- id: WeaponPistolMk58
- id: MagazinePistol
11 changes: 0 additions & 11 deletions Resources/Prototypes/ADT/Entities/Clothing/Head/hats.yml
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
- type: entity
parent: ClothingHeadBase
id: ADTClothingHeadUrsHat
name: urs hat
description: A futuristic looking striped hat from "STEP" clothing series.
components:
- type: Sprite
sprite: Clothing/Head/Hats/urs_hat.rsi
- type: Clothing
sprite: Clothing/Head/Hats/urs_hat.rsi

8 changes: 8 additions & 0 deletions Resources/Prototypes/ADT/Entities/Clothing/Neck/specific.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: entity
parent: ClothingNeckBase
id: ADTClothingNeckSecBadge
name: sec badge
description: sec badge
components:
- type: Sprite
sprite: ADT/Clothing/Neck/secbadge.rsi
36 changes: 0 additions & 36 deletions Resources/Prototypes/ADT/Entities/Clothing/OuterClothing/coats.yml
Original file line number Diff line number Diff line change
@@ -1,36 +0,0 @@
- type: entity
parent: ClothingOuterStorageBase
id: ADTClothingOuterCoatUrs
name: Urs outercoat.
description: Urs outercoat.
components:
- type: Sprite
sprite: ADT/Clothing/OuterClothing/Coats/urs_coat.rsi
- type: Clothing
sprite: ADT/Clothing/OuterClothing/Coats/urs_coat.rsi
- type: TemperatureProtection
coefficient: 0.9
- type: Armor
modifiers:
coefficients:
Slash: 0.95
Heat: 0.90

- type: entity
parent: ClothingOuterStorageBase
id: ADTClothingKadet
name: kadet greatcoat
description: a greatcoat made for recruits to the security service. It is very similar to the overcoat of the junior ranks of RIA
components:
- type: Sprite
sprite: ADT/Clothing/OuterClothing/Coats/kadet_trenchcoat.rsi
- type: Clothing
sprite: ADT/Clothing/OuterClothing/Coats/kadet_trenchcoat.rsi
- type: Armor
modifiers:
coefficients:
Blunt: 0.8
Slash: 0.8
Piercing: 0.7
Heat: 0.85

12 changes: 12 additions & 0 deletions Resources/Prototypes/ADT/Entities/Clothing/Uniforms/Jumpsuit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#Комбинезон следователя

- type: entity
parent: ClothingUniformBase
id: ADTClothingUniformInvestigatorSuit
name: investigator suit
description: The costume of the one who will get to the bottom of all the secrets.
components:
- type: Sprite
sprite: ADT/Clothing/Uniforms/Jumpsuit/investigator_suit.rsi
- type: Clothing
sprite: ADT/Clothing/Uniforms/Jumpsuit/investigator_suit.rsi
22 changes: 22 additions & 0 deletions Resources/Prototypes/ADT/Entities/Markers/Spawners/job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- type: entity
id: ADTSpawnPointJobBase
parent: MarkerBase
abstract: true
suffix: Job Spawn ADT
components:
- type: SpawnPoint
spawn_type: Job
- type: Sprite
sprite: ADT/Markers/job.rsi

- type: entity
id: ADTSpawnPointInvestigator
parent: ADTSpawnPointJobBase
name: Investigator
components:
- type: SpawnPoint
job_id: ADTInvestigator
- type: Sprite
layers:
- state: green
- state: investigator
15 changes: 15 additions & 0 deletions Resources/Prototypes/ADT/Entities/Objects/Device/pda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# КПК Следователя

- type: entity
parent: BasePDA
id: ADTInvestigatorPDA
name: investigator PDA
description: It smells like ink and the case is prematurely closed due to the death of a suspect at work.
components:
- type: Pda
id: ADTInvestigatorIDCard
state: pda-investigator
- type: PdaBorderColor
borderColor: "#774705"
- type: Icon
state: pda-investigator
Original file line number Diff line number Diff line change
@@ -1,37 +0,0 @@
- type: entity
parent: IDCardStandard
id: MagistratIDCard
name: magistrat ID card
description: magistrat ID card
components:
- type: Sprite
layers:
- state: silver
- state: idlawyer
- type: PresetIdCard
job: Magistrat

- type: entity
parent: IDCardStandard
id: ADTPathologistIDCard
name: pathologist's ID card
components:
- type: Sprite
sprite: ADT/Objects/Misc/id_cards.rsi
layers:
- state: default
- state: id-pathologist
- type: PresetIdCard
job: ADTPathologist

- type: entity
parent: IDCardStandard
id: ADTRoboticistIDCard
name: roboticist ID card
components:
- type: Sprite
layers:
- state: default
- state: idroboticist
- type: PresetIdCard
job: ADTRoboticist
Loading
Loading