-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* базовый оверлей (без реагента и очков) * Оно и не крашится и не работает ._. * Оно не крашится И оно работает * locale fix * Бутылочка с афродезиаком
- Loading branch information
Showing
16 changed files
with
249 additions
and
0 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,40 @@ | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared._Sunrise.Aphrodesiac; | ||
using System.Numerics; | ||
|
||
namespace Content.Client._Sunrise.LoveVision; | ||
|
||
public sealed class LoveVisionOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] IEntityManager _entityManager = default!; | ||
public override bool RequestScreenTexture => true; | ||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
private readonly ShaderInstance _loveVisionShader; | ||
|
||
public LoveVisionOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_loveVisionShader = _prototypeManager.Index<ShaderPrototype>("LoveVision").Instance().Duplicate(); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture == null) | ||
return; | ||
if (_playerManager.LocalSession?.AttachedEntity is not { Valid: true } player) | ||
return; | ||
if (!_entityManager.HasComponent<LoveVisionComponent>(player)) | ||
return; | ||
_loveVisionShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
var worldHandle = args.WorldHandle; | ||
var viewport = args.WorldBounds; | ||
worldHandle.SetTransform(Matrix3x2.Identity); | ||
worldHandle.UseShader(_loveVisionShader); | ||
worldHandle.DrawRect(viewport, Color.White); | ||
} | ||
} |
File renamed without changes.
51 changes: 51 additions & 0 deletions
51
Content.Client/_Sunrise/Overlays/Systems/LoveVisionSystem.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,51 @@ | ||
using Content.Shared._Sunrise.Aphrodesiac; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client._Sunrise.LoveVision; | ||
public sealed class LoveVisionSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
|
||
private LoveVisionOverlay _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<LoveVisionComponent, ComponentInit>(OnLoveVisionInit); | ||
SubscribeLocalEvent<LoveVisionComponent, ComponentShutdown>(OnLoveVisionShutdown); | ||
|
||
SubscribeLocalEvent<LoveVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<LoveVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
|
||
_overlay = new(); | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, LoveVisionComponent component, LocalPlayerAttachedEvent args) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnPlayerDetached(EntityUid uid, LoveVisionComponent component, LocalPlayerDetachedEvent args) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
|
||
private void OnLoveVisionInit(EntityUid uid, LoveVisionComponent component, ComponentInit args) | ||
{ | ||
if (_player.LocalSession?.AttachedEntity == uid) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnLoveVisionShutdown(EntityUid uid, LoveVisionComponent component, ComponentShutdown args) | ||
{ | ||
if (_player.LocalSession?.AttachedEntity == uid) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} | ||
} |
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,7 @@ | ||
using Content.Shared._Sunrise.Aphrodesiac; | ||
|
||
namespace Content.Server._Sunrise.Aphrodesiac; | ||
|
||
public sealed class AphrodesiacSystem : SharedAphrodesiacSystem | ||
{ | ||
} |
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,23 @@ | ||
using Content.Shared.Chemistry.Reagent; | ||
using Content.Shared._Sunrise.Aphrodesiac; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Chemistry.ReagentEffects; | ||
|
||
public sealed partial class LoveEffect : ReagentEffect | ||
{ | ||
[DataField] | ||
public float EffectPower = 3f; | ||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
=> Loc.GetString("reagent-effect-guidebook-love"); | ||
|
||
public override void Effect(ReagentEffectArgs args) | ||
{ | ||
var effectPower = EffectPower; | ||
|
||
effectPower *= args.Scale; | ||
|
||
var loveVisionSys = args.EntityManager.EntitySysManager.GetEntitySystem<SharedAphrodesiacSystem>(); | ||
loveVisionSys.TryApplyLoveenness(args.SolutionEntity, effectPower); | ||
} | ||
} |
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._Sunrise.Aphrodesiac; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class LoveVisionComponent : Component | ||
{ | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
Content.Shared/_Sunrise/Aphrodesiac/SharedAphrodesiacSystem.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,38 @@ | ||
using Content.Shared.Speech.EntitySystems; | ||
using Content.Shared.StatusEffect; | ||
using Content.Shared.Traits.Assorted; | ||
|
||
namespace Content.Shared._Sunrise.Aphrodesiac; | ||
|
||
public abstract class SharedAphrodesiacSystem : EntitySystem | ||
{ | ||
[ValidatePrototypeId<StatusEffectPrototype>] | ||
public const string LoveKey = "LoveEffect"; | ||
|
||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; | ||
|
||
public void TryApplyLoveenness(EntityUid uid, float effectPower, StatusEffectsComponent? status = null) | ||
{ | ||
if (!Resolve(uid, ref status, false)) | ||
return; | ||
|
||
if (!_statusEffectsSystem.HasStatusEffect(uid, LoveKey, status)) | ||
{ | ||
_statusEffectsSystem.TryAddStatusEffect<LoveVisionComponent>(uid, LoveKey, TimeSpan.FromSeconds(effectPower), true, status); | ||
} | ||
else | ||
{ | ||
_statusEffectsSystem.TryAddTime(uid, LoveKey, TimeSpan.FromSeconds(effectPower), status); | ||
} | ||
} | ||
|
||
public void TryRemoveLovenness(EntityUid uid) | ||
{ | ||
_statusEffectsSystem.TryRemoveStatusEffect(uid, LoveKey); | ||
} | ||
public void TryRemoveLovenessTime(EntityUid uid, double timeRemoved) | ||
{ | ||
_statusEffectsSystem.TryRemoveTime(uid, LoveKey, TimeSpan.FromSeconds(timeRemoved)); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
Resources/Locale/en-US/_sunrise/aphrodesiac/aphrodesiac.ftl
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,10 @@ | ||
reagent-name-aphrodesiac = Aphrodesiac | ||
reagent-desc-aphrodesiac = A substance that increases arousal or pleasure. | ||
reagent-physical-desc-aphrodesiac = Shimmering, ruby-red liquid that glows softly in the light. | ||
aphrodesiac-effect1 = Your skin tingles warmly. | ||
aphrodesiac-effect2 = Your heart is racing fast. | ||
reagent-effect-guidebook-love = | ||
{ $chance -> | ||
[1] Causes | ||
*[other] cause | ||
} subject to fall in love. |
12 changes: 12 additions & 0 deletions
12
Resources/Locale/ru-RU/_sunrise/aphrodesiac/aphrodesiac.ftl
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,12 @@ | ||
reagent-name-aphrodesiac = Афродезиак | ||
reagent-desc-aphrodesiac = Вещество, которое усиливает возбуждение или удовольствие. | ||
reagent-physical-desc-aphrodesiac = Мерцающая, рубиново-красная жидкость, мягко светящаяся на свету. | ||
aphrodesiac-effect1 = Ваша кожа приятно покалывает. | ||
aphrodesiac-effect2 = Ваше сердце быстро бьется. | ||
reagent-effect-guidebook-love = | ||
{ $chance -> | ||
[1] Вызывает | ||
*[other] вызывают | ||
} измененное состояние сознания. | ||
ent-AphrodesiacChemistryBottle = бутылочка афродезиака | ||
.desc = { ent-BaseChemistryBottleFilled.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- type: shader | ||
id: LoveVision | ||
kind: source | ||
path: "/Textures/Shaders/lovevision.swsl" |
12 changes: 12 additions & 0 deletions
12
Resources/Prototypes/_Sunrise/Entities/Objects/Specific/chemistry-bottles.yml
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,12 @@ | ||
- type: entity | ||
id: AphrodesiacChemistryBottle | ||
name: aphrodesiac bottle | ||
parent: BaseChemistryBottleFilled | ||
components: | ||
- type: SolutionContainerManager | ||
solutions: | ||
drink: | ||
maxVol: 30 | ||
reagents: | ||
- ReagentId: Aphrodesiac | ||
Quantity: 30 |
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,17 @@ | ||
- type: reagent | ||
id: Aphrodesiac | ||
name: reagent-name-aphrodesiac | ||
group: Special | ||
desc: reagent-desc-aphrodesiac | ||
physicalDesc: reagent-physical-desc-aphrodesiac | ||
flavor: funny | ||
color: "#FF00E8" | ||
metabolisms: | ||
Poison: | ||
effects: | ||
- !type:PopupMessage | ||
type: Local | ||
messages: [ "aphrodesiac-effect1", "aphrodesiac-effect2" ] | ||
probability: 0.1 | ||
- !type:LoveEffect | ||
effectPower: 2 |
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 @@ | ||
- type: reaction | ||
id: Aphrodesiac | ||
reactants: | ||
Omnizine: | ||
amount: 2 | ||
Leporazine: | ||
amount: 3 | ||
products: | ||
Aphrodesiac: 5 |
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,2 @@ | ||
- type: statusEffect | ||
id: LoveEffect |
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 @@ | ||
uniform sampler2D SCREEN_TEXTURE; | ||
|
||
void fragment() { | ||
highp vec4 color = zTextureSpec(SCREEN_TEXTURE, UV); | ||
|
||
highp mat3 m = mat3( | ||
vec3(1.0, 0.3, 0.3), | ||
vec3(0.6, 0.3, 0.3), | ||
vec3(0.6, 0.3, 1.0) | ||
); | ||
highp vec3 result = color.rgb * m; | ||
|
||
COLOR = vec4(result, 1.0); | ||
} |