Compare commits
4 Commits
ed-revert-
...
ed-12-11-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a22bd9caed | ||
|
|
3249bcfbcb | ||
|
|
c33c655911 | ||
|
|
b009c7b93a |
@@ -43,6 +43,7 @@ public sealed partial class ContentAudioSystem
|
||||
|
||||
private void CP14UpdateAmbientLoops()
|
||||
{
|
||||
|
||||
return; //DISABLED UNTIL CLIENT ERROR SPAM FIXED
|
||||
|
||||
if (_timing.CurTime <= _nextUpdateTime)
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace Content.Server.Shuttles.Components
|
||||
/// Damping applied to the shuttle's physics component when not in FTL.
|
||||
/// </summary>
|
||||
[DataField("linearDamping"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float LinearDamping = 0.05f;
|
||||
public float LinearDamping = 0.5f;//0.05f; //CP14 - the ocean is much denser than space, you know.
|
||||
|
||||
[DataField("angularDamping"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float AngularDamping = 0.05f;
|
||||
public float AngularDamping = 0.5f; //0.05f; //CP14 - the ocean is much denser than space, you know.
|
||||
}
|
||||
}
|
||||
|
||||
14
Content.Shared/_CP14/Shuttle/CP14WatershipPaddleComponent.cs
Normal file
14
Content.Shared/_CP14/Shuttle/CP14WatershipPaddleComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Content.Shared._CP14.Shuttle;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14WatershipSystem))]
|
||||
public sealed partial class CP14WaterShipPaddleComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public float Power = 5f;
|
||||
|
||||
[DataField]
|
||||
public Angle ImpulseAngle = Angle.FromDegrees(90f);
|
||||
}
|
||||
67
Content.Shared/_CP14/Shuttle/CP14WatershipSystem.cs
Normal file
67
Content.Shared/_CP14/Shuttle/CP14WatershipSystem.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Construction.EntitySystems;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Shared._CP14.Shuttle;
|
||||
|
||||
public sealed class CP14WatershipSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<CP14WaterShipPaddleComponent, GetVerbsEvent<ActivationVerb>>(OnPaddleForward);
|
||||
SubscribeLocalEvent<CP14WaterShipPaddleComponent, GetVerbsEvent<AlternativeVerb>>(OnPaddleBackward);
|
||||
}
|
||||
|
||||
private void OnPaddleForward(Entity<CP14WaterShipPaddleComponent> ent, ref GetVerbsEvent<ActivationVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
var paddleTransform = Transform(ent);
|
||||
|
||||
if (!paddleTransform.Anchored)
|
||||
return;
|
||||
|
||||
var verb = new ActivationVerb
|
||||
{
|
||||
Text = "Forward",
|
||||
Priority = 1,
|
||||
Act = () => Bulb(ent, paddleTransform, 1)
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void OnPaddleBackward(Entity<CP14WaterShipPaddleComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
var paddleTransform = Transform(ent);
|
||||
|
||||
if (!paddleTransform.Anchored)
|
||||
return;
|
||||
|
||||
var verb = new AlternativeVerb
|
||||
{
|
||||
Text = "Backward",
|
||||
Priority = 2,
|
||||
Act = () => Bulb(ent, paddleTransform, -1)
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void Bulb(Entity<CP14WaterShipPaddleComponent> ent, TransformComponent paddleTransform, float modifier)
|
||||
{
|
||||
if (paddleTransform.GridUid is null)
|
||||
return;
|
||||
|
||||
var direction = _transform.GetWorldRotation(paddleTransform) + ent.Comp.ImpulseAngle;
|
||||
var impulseDirection = direction.ToVec();
|
||||
|
||||
_physics.ApplyLinearImpulse(paddleTransform.GridUid.Value, impulseDirection * ent.Comp.Power * modifier, paddleTransform.LocalPosition);
|
||||
}
|
||||
}
|
||||
62
Resources/Prototypes/_CP14/Entities/watershipTEST.yml
Normal file
62
Resources/Prototypes/_CP14/Entities/watershipTEST.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
- type: entity
|
||||
name: ship paddle
|
||||
id: CP14BaseWatershipPaddle
|
||||
abstract: true
|
||||
parent:
|
||||
- BaseStructure
|
||||
description: bulb bulb
|
||||
categories: [ ForkFiltered ]
|
||||
components:
|
||||
- type: Physics
|
||||
bodyType: Static
|
||||
- type: Fixtures
|
||||
fixtures:
|
||||
fix1:
|
||||
shape:
|
||||
!type:PhysShapeAabb
|
||||
bounds: "-0.45,-0.45,0.45,0.05"
|
||||
density: 190
|
||||
mask:
|
||||
- TableMask
|
||||
- type: Sprite
|
||||
sprite: _CP14/Structures/Shuttle/paddle.rsi
|
||||
- type: Damageable
|
||||
damageContainer: Inorganic
|
||||
damageModifierSet: Wood
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 75
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: ["Destruction"]
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
CP14WoodenPlanks1:
|
||||
min: 2
|
||||
max: 4
|
||||
- type: Transform
|
||||
anchored: true
|
||||
- type: Anchorable
|
||||
- type: Pullable
|
||||
- type: CP14WaterShipPaddle
|
||||
impulseAngle: 90
|
||||
|
||||
- type: entity
|
||||
parent: CP14BaseWatershipPaddle
|
||||
id: CP14WatershipPaddleLeft
|
||||
suffix: Left
|
||||
components:
|
||||
- type: Sprite
|
||||
state: wooden_l
|
||||
- type: CP14WaterShipPaddle
|
||||
|
||||
- type: entity
|
||||
parent: CP14BaseWatershipPaddle
|
||||
id: CP14WatershipPaddleRight
|
||||
suffix: Right
|
||||
components:
|
||||
- type: Sprite
|
||||
state: wooden_r
|
||||
- type: CP14WaterShipPaddle
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CLA",
|
||||
"copyright": "Created by TheShuEd (Github) for CrystallPunk14",
|
||||
"size": {
|
||||
"x": 96,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "wooden_l"
|
||||
},
|
||||
{
|
||||
"name": "wooden_r"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 486 B |
Binary file not shown.
|
After Width: | Height: | Size: 468 B |
Reference in New Issue
Block a user