Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c32824d
кораблики
Magic0stick Feb 11, 2026
d13a059
делаем волны
Magic0stick Feb 12, 2026
f4b1bd6
волны урааа
Magic0stick Feb 12, 2026
cc4e761
Мапы топят
Magic0stick Feb 14, 2026
ccd239c
волны и утопление фул
Magic0stick Feb 14, 2026
1761cb8
Merge branch 'imperial-space:develop' into Second
Magic0stick Feb 14, 2026
8f2613b
выгружаем кучу всего
Magic0stick Mar 6, 2026
2cc4edd
Merge branch 'imperial-space:develop' into Second
Magic0stick Mar 6, 2026
d6ba313
фиксы
Magic0stick Mar 6, 2026
599b143
лейся варево фиксы и развёртывание паруса
Magic0stick Mar 6, 2026
b666e10
якоря?
Magic0stick Mar 7, 2026
6bc1330
Якоря теперь готовы
Magic0stick Mar 7, 2026
4bb2cf9
добавляем попап вёслам и шторм
Magic0stick Mar 8, 2026
54339d3
фиксы для весла, добавил волны
Magic0stick Mar 11, 2026
5f85677
привет куча цваров
Magic0stick Mar 12, 2026
a1781fb
Больше цваров
Magic0stick Mar 12, 2026
696da02
фиксим волны, добавляем первичный телепорт
Magic0stick Mar 13, 2026
cbd9262
первичная генерация морей
Magic0stick Mar 14, 2026
3a72432
кораблики теперь плавают между картами
Magic0stick Mar 17, 2026
4db8095
телепортация и моря
Magic0stick Mar 18, 2026
11f3dac
Merge branch 'imperial-space:develop' into Second
Magic0stick Mar 18, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// тут мог бы быть ваш код)
// но я криворукий бэкэндер который в душе не чает как работать нормально с визуалом поэтому тут пусто
// TODO : сделать нормальное отображение потопления, а не тот костыль который я сделаю
17 changes: 17 additions & 0 deletions Content.Server/Imperial/Medieval/Barrier/MagicBarrierComponent.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using System.Numerics;
using Content.Server.Imperial.Medieval.Ships.Sea.Init;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Prototypes;
Expand All @@ -21,15 +24,19 @@ public sealed partial class MagicBarrierComponent : Component

[DataField]
public float MaxStability = 60f;

[DataField]
public float Lose = 0.7f;

[DataField]
public float Rate = 1.5f;

[DataField]
public int Cycle = 0;

[DataField, ViewVariables(VVAccess.ReadOnly)]
public string EffectSoundOnScrollAdd = "/Audio/Imperial/Medieval/scroll_use.ogg";

[DataField, ViewVariables(VVAccess.ReadOnly)]
public string EffectSoundOnFinish = "/Audio/Imperial/Medieval/magic_craft.ogg";

Expand All @@ -49,5 +56,15 @@ public sealed partial class MagicBarrierComponent : Component
[DataField]
public Dictionary<NetUserId, int> ReviveCount = new();


// Приветик, делаем генерацию морей
[DataField]
public bool SeaInitalazed = false;


[DataField]
public SeaMatrix? SeaMatrix = null;
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Systems;
using Content.Shared.Imperial.Medieval.Ships.Anchor;

namespace Content.Server.Imperial.Medieval.Ships.Anchor;

/// <summary>
/// This handles...
/// </summary>
public sealed class ServerMedievalAnchorSystem : EntitySystem
{
[Dependency] private readonly ShuttleSystem _shuttleSystem = default!;
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<MedievalAnchorComponent, UseAnchorEvent>(OnUseAnchor);
}

private void OnUseAnchor(EntityUid uid, MedievalAnchorComponent component, UseAnchorEvent args)
{
if (args.Target == null || args.Cancelled)
return;

var target = component.Owner;

var enabled = component.Enabled;

ShuttleComponent? shuttleComponent = default;

var transform = Transform(target);
var grid = transform.GridUid;
if (!grid.HasValue || !transform.Anchored || !Resolve(grid.Value, ref shuttleComponent))
return;

if (!enabled)
{
_shuttleSystem.Disable(grid.Value);
}
else
{
_shuttleSystem.Enable(grid.Value);
}

shuttleComponent.Enabled = !enabled;
component.Enabled = !enabled;
}
}
75 changes: 75 additions & 0 deletions Content.Server/Imperial/Medieval/Ships/Helm/HelmSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System.Numerics;
using Content.Server.Administration.Logs;
using Content.Shared._RD.Weight.Systems;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Imperial.Medieval.Skills;
using Content.Shared.Popups;
using NetCord;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing;

namespace Content.Server.Imperial.Medieval.Ships.Helm;

/// <summary>
/// This handles...
/// </summary>
public sealed class HelmSystem : EntitySystem
{
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedSkillsSystem _skills = default!;
[Dependency] private readonly EntityManager _entManager = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly RDWeightSystem _rdWeight = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IAdminLogManager _adminLog = default!;

public void RotateShip(EntityUid boat, EntityUid helm, float helmForce)
{
_physics.WakeBody(boat);
var helmAngle = _transform.GetWorldRotation(helm);
var entities = _lookup.GetEntitiesIntersecting(boat);
EntityUid? steeringOar = null;
foreach (var e in entities)
{
if (HasComp<SteeringOarComponent>(e))
{
steeringOar = e;
break;
}
}
if (steeringOar == null)
return;
var steeringOarAngle = _transform.GetWorldRotation(steeringOar.Value);
var diff = (float)steeringOarAngle*180 - (float)helmAngle*180;
diff *= -1;
if (helmForce > 0)
{
_physics.ApplyAngularImpulse(boat, diff);
return;
}
if (helmForce < 0)
{
_physics.ApplyAngularImpulse(boat, -diff);
return;
}
}

public float CheckForce(EntityUid boat, EntityUid helm)
{
var boatAngle = (float)_transform.GetWorldRotation(boat)*180;
var helmcos = MathF.Cos(boatAngle);
var helmsin = MathF.Sin(boatAngle);
var helmVector = _physics.GetMapLinearVelocity(boat);
var helmForce = Math.Abs(helmVector.X) + Math.Abs(helmVector.Y);
return helmForce;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Server.Imperial.Medieval.Ships.Helm;

/// <summary>
/// This is used for...
/// </summary>
[RegisterComponent]
public sealed partial class SteeringOarComponent : Component
{

}
131 changes: 131 additions & 0 deletions Content.Server/Imperial/Medieval/Ships/Oar/ServerOarSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
using System.Numerics;
using Content.Shared._RD.Weight.Components;
using Content.Shared._RD.Weight.Systems;
using Content.Shared.Coordinates;
using Content.Shared.DoAfter;
using Content.Shared.Imperial.Medieval.Skills;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Popups;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;


using Content.Shared.Database;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Imperial.Medieval.Ships.Oar;
using Content.Shared.Interaction.Components;
using Content.Shared.Movement.Components;


namespace Content.Server.Imperial.Medieval.Ships.Oar;

/// <summary>
/// This handles...
/// </summary>
public sealed class OarSystem : EntitySystem
{
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedSkillsSystem _skills = default!;
[Dependency] private readonly EntityManager _entManager = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly RDWeightSystem _rdWeight = default!;
public override void Initialize()
{
SubscribeLocalEvent<OarComponent, OnOarDoAfterEvent>(OnOarDoAfter);
}

private void OnOarDoAfter(EntityUid uid, OarComponent component, ref OnOarDoAfterEvent args)
{
if (args.Cancelled)
{
RemComp<NoRotateOnInteractComponent>(args.User);
RemComp<NoRotateOnMoveComponent>(args.User);
}

var item = _hands.GetActiveItem(args.User);
if (args.Cancelled || args.Handled || item == null)
return;

if (!TryComp<OarComponent>(item, out var comp))
return;

Push(item.Value, comp.Direction, comp.Power, args.User);
args.Handled = true;
args.Repeat = true;
}

private void Push(EntityUid item, Angle direction, float power, EntityUid player)
{
power += power * (-10 + _skills.GetSkillLevel(player, "Strength")) * 0.1f;

var boat = _transform.GetParentUid(player);

var boatAngle = _transform.GetWorldRotation(boat);

var playerAngle = _transform.GetWorldRotation(player);

var entities = _lookup.GetEntitiesIntersecting(boat);

if (entities.Count > 1000)
return;

var weight = _rdWeight.GetTotal(boat);

foreach (var entity in entities)
{
if (HasComp<RDWeightComponent>(entity))
weight += _rdWeight.GetTotal(entity);
}

if (weight == 0)
weight = 10;

var directionVec = Vector2.Zero;
while (direction > 2)
{
direction -= 2;
}


direction += Angle.FromDegrees(45);
// от 0 до 0.5 (1,0)
// от 0.5 до 1 (0,1)
// от 1 до 1,5 (0,-1)
// от 1,5 до 0 (-1,0)
if (direction > 1)
{
if (direction > 1.5)
directionVec = new Vector2(-1,0);
else
{
directionVec = new Vector2(0,-1);
}
}
else
{
if (direction > 0.5)
directionVec = new Vector2(0,1);
else
{
directionVec = new Vector2(1,0);
}
}

directionVec = playerAngle.RotateVec(directionVec);
var impulse = directionVec * (power / weight);
var angleimpulse = (power / weight);

if (EntityManager.TryGetComponent(boat, out PhysicsComponent? body))
{
_physics.WakeBody(boat);
_physics.ApplyLinearImpulse(boat, impulse, body: body);
// _physics.ApplyAngularImpulse(boat, angleimpulse, body: body);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Content.Server.Imperial.Medieval.Ships.PlayerDrowning;

/// <summary>
/// This is used for...
/// </summary>
[RegisterComponent]
public sealed partial class DrownerComponent : Component
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Server.Imperial.Medieval.Ships.PlayerDrowning;

/// <summary>
/// This is used for...
/// </summary>
[RegisterComponent]
public sealed partial class PlayerDrowningComponent : Component
{
[DataField("drownTime")]
public int DrownTime;

[DataField("Undrowable")]
public bool Undrowable;
}
Loading
Loading