Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 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
33 changes: 18 additions & 15 deletions Content.Shared/_Scp/Research/Interact/ScpInteractSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Robust.Shared.Network;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Content.Shared.Trigger.Systems;

namespace Content.Shared._Scp.Research.Interact;

Expand All @@ -31,6 +32,7 @@ public sealed partial class ScpInteractSystem : EntitySystem
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly TriggerSystem _trigger = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -94,29 +96,30 @@ private void OnInteractSuccessful(Entity<ScpComponent> scp, ref ScpSpawnInteract
return;

var tool = args.Tool;

if (!TryComp<ScpInteractToolComponent>(tool, out var researchTool))
return;

scp.Comp.TimeLastInteracted = _timing.CurTime;
Dirty(scp);
args.Handled = true;

if (_net.IsServer)
{
// Случайное количество спавна. Берем +1, так как максимальная граница не включена
var count = _random.Next(args.MinSpawn, args.MaxSpawn + 1);

for (var i = 0; i < count; i++)
if (args.ToSpawn is { } toSpawn)
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
Outdated
{
if (researchTool.Sound != null)
_audio.PlayPvs(researchTool.Sound, scp);

Spawn(args.ToSpawn, Transform(scp).Coordinates);
var count = _random.Next(args.MinSpawn, args.MaxSpawn + 1);
for (var i = 0; i < count; i++)
{
if (researchTool.Sound != null)
_audio.PlayPvs(researchTool.Sound, scp);

Spawn(toSpawn, Transform(scp).Coordinates);
}
}
}

// Задаем последнее время использования для кулдауна
scp.Comp.TimeLastInteracted = _timing.CurTime;
Dirty(scp);

args.Handled = true;
if (args.ShouldTriggerPolymorph)
_trigger.Trigger(scp);
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
Outdated
}
}

}
11 changes: 9 additions & 2 deletions Content.Shared/_Scp/Research/ScpResearchEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public sealed partial class ScpSpawnInteractDoAfterEvent : BaseScpInteractDoAfte
/// Исследовательский материал, который будет получен в результате взаимодействия с СЦП.
/// </summary>
[DataField]
public EntProtoId ToSpawn;
public EntProtoId? ToSpawn;

/// <summary>
/// Максимальное количество материала, который будет заспавнен
Expand All @@ -46,14 +46,21 @@ public sealed partial class ScpSpawnInteractDoAfterEvent : BaseScpInteractDoAfte
/// </summary>
[DataField]
public int MaxSpawn = 1;

/// <summary>
/// Будет ли вызван триггер полиморфа на сцп
/// </summary>
[DataField]
public bool ShouldTriggerPolymorph = false;

public ScpSpawnInteractDoAfterEvent() {}

public ScpSpawnInteractDoAfterEvent(EntProtoId toSpawn, int minSpawn, int maxSpawn)
public ScpSpawnInteractDoAfterEvent(EntProtoId? toSpawn, int minSpawn, int maxSpawn, bool shouldTrigger = false)
{
ToSpawn = toSpawn;
MinSpawn = minSpawn;
MaxSpawn = maxSpawn;
ShouldTriggerPolymorph = shouldTrigger;
}
}

Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/_Scp/Scp066/Scp066Component.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Shared._Scp.Scp066;

[RegisterComponent]
public sealed partial class Scp066FriendlyComponent : Component { }

[RegisterComponent]
public sealed partial class Scp066HostileComponent : Component { }
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
Outdated
Binary file added Resources/Audio/_Scp/Scp066/Beethoven.ogg
Binary file not shown.
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Resources/Audio/_Scp/Scp066/Party1.ogg
Binary file not shown.
12 changes: 12 additions & 0 deletions Resources/Locale/ru-RU/_prototypes/_scp/actions/scp066.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ent-Scp066SpawnCake = предложить торт
.desc = Вы создаете кусочек праздничного торта для вечеринки!
ent-Scp066SpawnPlushieCat = подарить игрушку
.desc = Вы создаете красивую игрушку белой кошки.
ent-Scp066SpawnDelightGlass = здоровый напиток
.desc = Вы создаете стакан с лечащим напитком внутри.
ent-Scp066DisableLights = аномальные неполадки
.desc = Вы выводите из строя всю технику поблизости.
ent-Scp066OpenDoors = уроки взлома
.desc = Вы открываете все шлюзы поблизости.
ent-Scp066SpawnAngryBee = неожиданный удар
.desc = Из вашего тела вылетает агрессивная пчела.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-Scp066Hostile = ???
ent-Scp066Friendly = ???
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ent-CrateScpCage = Ангар «Пандора»
ent-CrateScpCageScp173 = { ent-CrateScpCage }
.desc = { ent-CrateScpCage.desc }
.suffix = SCP-173
ent-CrateScpCageScp066 = Ангар «Диатоника»
.desc = Складной и запираемый контейнер для переноски хрупких SCP, сочетающий в себе удобство и максимальную сохранность объекта в процессе транспортировки. Может быть свернут и развернут с помощью отвертки
.suffix = SCP-066
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ ent-Scp096PhotoDeveloped = странная фотография
.desc = Небольшая фотография формата 4:3. Ее края выглядят помятыми, кажется, кто-то носил ее с собой раньше... Вы пытаетесь разглядеть изображение...
ent-Scp096Photo = странная фотография
.desc = Небольшая фотография, на которой практически неразличимо содержимое.
ent-Scp066Ribbon = кусок аномальных нитей
.desc = Экземпляр мягких и разноцветных нитей. Их края подёргиваются.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ ent-PosterSCP035 = плакат «SCP-035»
.desc = Информационный плакат SCP-035
ent-PosterSCP049 = плакат «SCP-049»
.desc = Информационный плакат SCP-049
ent-PosterSCP066 = плакат «SCP-066»
.desc = Информационный плакат SCP-066
ent-PosterSCP082 = плакат «SCP-082»
.desc = Информационный плакат SCP-082
ent-PosterSCP096 = плакат «SCP-096»
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ent-SignDirectionalScp035 = указатель «SCP-035»
.desc = { ent-BaseSignDirectionalScp.desc }
ent-SignDirectionalScp049 = указатель «SCP-049»
.desc = { ent-BaseSignDirectionalScp.desc }
ent-SignDirectionalScp066 = указатель «SCP-066»
.desc = { ent-BaseSignDirectionalScp.desc }
ent-SignDirectionalScp096 = указатель «SCP-096»
.desc = { ent-BaseSignDirectionalScp.desc }
ent-SignDirectionalScp101 = указатель «SCP-101»
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,22 @@
path: /Audio/_Sunrise/Medical/Surgery/retractor1.ogg
endSound:
path: /Audio/_Sunrise/Medical/Surgery/retractor2.ogg
# Fire edit start - исследования сцп
- type: ScpInteractTool
delay: 10
cooldown: 600 # 5 минут
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
cooldownMessage: scp-interact-time-left
event: !type:ScpSpawnInteractDoAfterEvent
toSpawn: Scp066Ribbon
shouldTriggerPolymorph: true
sound: /Audio/Items/multitool_drop.ogg
whitelist:
components:
- Scp066Friendly
- type: GuideHelp
guides:
- ScpResearchAdvanced
# Fire edit end

- type: entity
name: advanced retractor
Expand Down
106 changes: 106 additions & 0 deletions Resources/Prototypes/_Scp/Actions/scp066.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Friendly 066

- type: entity
parent: BaseAction
id: Scp066SpawnCake
name: offer a cake
description: You create a slice of birthday cake for the party!
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 90
sound: /Audio/_Scp/Scp066/Party1.ogg
icon:
sprite: Objects/Consumable/Food/Baked/cake.rsi
state: birthday
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
- type: InstantAction
event: !type:InstantSpawnSpellEvent
prototype: FoodCakeBirthdaySlice
Comment thread
666XxttimurkaxX666 marked this conversation as resolved.
posData: !type:TargetCasterPos

- type: entity
parent: BaseAction
id: Scp066SpawnPlushieCat
name: give a toy
description: You create a beautiful white cat plushie.
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 90
icon:
sprite: _Sunrise/Objects/Fun/toy_cats.rsi
state: plushie_whitecat
- type: InstantAction
event: !type:InstantSpawnSpellEvent
prototype: PlushieWhiteCat
posData: !type:TargetCasterPos

- type: entity
parent: BaseAction
id: Scp066SpawnDelightGlass
name: healthy drink
description: You create a glass with a healing beverage inside.
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 120
icon:
sprite: Objects/Consumable/Drinks/doctorsdelightglass.rsi
state: icon_empty
- type: InstantAction
event: !type:InstantSpawnSpellEvent
prototype: DrinkDoctorsDelightGlass
posData: !type:TargetCasterPos

# Hostile 066

- type: entity
parent: BaseAction
id: Scp066OpenDoors
name: lockpicking lessons
description: You force all nearby airlocks to open.
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 90
icon:
sprite: _Scp/Actions/scp-066.rsi
state: airlock
itemIconStyle: BigAction
raiseOnUser: true
- type: InstantAction
event: !type:KnockSpellEvent

Comment thread
coderabbitai[bot] marked this conversation as resolved.
- type: entity
parent: BaseAction
id: Scp066SpawnAngryBee
name: unexpected strike
description: An aggressive bee flies out of your body.
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 90
icon:
sprite: Objects/Fun/Plushies/bee.rsi
state: icon
- type: InstantAction
event: !type:InstantSpawnSpellEvent
prototype: MobAngryBee
posData: !type:TargetCasterPos

- type: entity
parent: BaseAction
id: Scp066DisableLights
name: anomalous malfunction
description: You disable all nearby electronics and lights.
categories: [ HideSpawnMenu ]
components:
- type: Action
useDelay: 90
icon:
sprite: _Scp/Actions/scp-066.rsi
state: light
- type: InstantAction
event: !type:InstantSpawnSpellEvent
prototype: AdminInstantEffectEMP
posData: !type:TargetCasterPos
14 changes: 14 additions & 0 deletions Resources/Prototypes/_Scp/Entities/Markers/scp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@
- type: ConditionalSpawner
prototypes:
- Scp131A

- type: entity
name: SCP-066 spawner
id: SpawnScp066
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Scp/Mobs/Scp/scp-066.rsi
state: scp-066friendly
- type: ConditionalSpawner
prototypes:
- Scp066Friendly

- type: entity
name: SCP-131-B spawner
Expand Down
Loading
Loading