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

PTK Rework #2521

Merged
merged 32 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
64100af
PTK changes: proof of concept
whatston3 Dec 4, 2024
7a06ce0
Add hard rock ores for other asteroids than ice
whatston3 Dec 6, 2024
685f707
IconSmoothSystem: reduce redundnacy
whatston3 Dec 6, 2024
b98d7ed
add NF prefix to OreDiamondDense refs
whatston3 Dec 6, 2024
3d0195b
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Dec 8, 2024
789c873
Merge branch 'master' into 2024-12-06-ptk-rework
dvir001 Dec 9, 2024
ee98179
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Dec 12, 2024
53b2913
Fix salvage.yml merge issues
whatston3 Dec 12, 2024
9a32a79
Merge branch 'master' into 2024-12-06-ptk-rework
whatston3 Dec 13, 2024
1a47da9
No duped crate spawner
whatston3 Dec 13, 2024
ca17b3a
PTK-1500e, not 3000e
whatston3 Dec 13, 2024
fa6bf0a
Fix asteroid scrap spawner parenting
whatston3 Dec 13, 2024
baaf135
PTK description
whatston3 Dec 13, 2024
b8fb174
Add "overpowered" comment on PTK
whatston3 Dec 13, 2024
01bf463
Merge branch 'master' into 2024-12-06-ptk-rework
dvir001 Dec 20, 2024
0ff2576
Merge branch 'master' into 2024-12-06-ptk-rework
dvir001 Dec 20, 2024
53ddf7a
Create supercompacted.yml
dvir001 Dec 20, 2024
efd7615
Added super compacted spawners
dvir001 Dec 20, 2024
7ec1551
Update supercompacted.yml
dvir001 Dec 20, 2024
315a1bf
mineral spawners
whatston3 Dec 20, 2024
9903251
undupe spawners
whatston3 Dec 20, 2024
67f37e1
Separate mineral tables out from floorplan
whatston3 Dec 20, 2024
2f1e83c
Fix scrap mineral table
whatston3 Dec 20, 2024
5b27079
WIP: add RoomMarkers
whatston3 Dec 20, 2024
0821898
minerals to spawners, fix rock dupe
whatston3 Dec 21, 2024
71a0118
Fix missing ice spawner ref
whatston3 Dec 21, 2024
c929468
Sprites for mineral spawns, hard supercomp. spawns
whatston3 Dec 23, 2024
d824ee7
rich hard mineral spawners
whatston3 Dec 23, 2024
6ad336c
fewer diamonds on andesite, more chunk spawners
whatston3 Dec 23, 2024
07b1976
More frequent clusters
whatston3 Dec 24, 2024
8595330
order of magnitude
whatston3 Dec 24, 2024
dbf4124
Merge branch 'master' into 2024-12-06-ptk-rework
dvir001 Dec 24, 2024
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
30 changes: 17 additions & 13 deletions Content.Client/IconSmoothing/IconSmoothSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,25 @@ public void SetStateBase(EntityUid uid, IconSmoothComponent component, string ne

private void SetCornerLayers(SpriteComponent sprite, IconSmoothComponent component)
{
sprite.LayerMapRemove(CornerLayers.SE);
sprite.LayerMapRemove(CornerLayers.NE);
sprite.LayerMapRemove(CornerLayers.NW);
sprite.LayerMapRemove(CornerLayers.SW);

// Frontier: Allow overlays on entities using CornerLayers smoothing - don't remove layers, adjust existing ones or create new ones.
var state0 = $"{component.StateBase}0";
sprite.LayerMapSet(CornerLayers.SE, sprite.AddLayerState(state0));
sprite.LayerSetDirOffset(CornerLayers.SE, DirectionOffset.None);
sprite.LayerMapSet(CornerLayers.NE, sprite.AddLayerState(state0));
sprite.LayerSetDirOffset(CornerLayers.NE, DirectionOffset.CounterClockwise);
sprite.LayerMapSet(CornerLayers.NW, sprite.AddLayerState(state0));
sprite.LayerSetDirOffset(CornerLayers.NW, DirectionOffset.Flip);
sprite.LayerMapSet(CornerLayers.SW, sprite.AddLayerState(state0));
sprite.LayerSetDirOffset(CornerLayers.SW, DirectionOffset.Clockwise);
SetCornerLayerState(sprite, CornerLayers.SE, DirectionOffset.None, state0);
SetCornerLayerState(sprite, CornerLayers.NE, DirectionOffset.CounterClockwise, state0);
SetCornerLayerState(sprite, CornerLayers.NW, DirectionOffset.Flip, state0);
SetCornerLayerState(sprite, CornerLayers.SW, DirectionOffset.Clockwise, state0);
// End Frontier: Allow overlays on entities using CornerLayers smoothing - don't remove layers, adjust existing ones or create new ones.
}

// Frontier: set layer function to remove redundancy
private void SetCornerLayerState(SpriteComponent sprite, CornerLayers corner, DirectionOffset offset, string state)
{
if (sprite.LayerMapTryGet(corner, out var layer))
sprite.LayerSetState(layer, state);
else
sprite.LayerMapSet(corner, sprite.AddLayerState(state));
sprite.LayerSetDirOffset(corner, offset);
}
// End Frontier: set layer function to remove redundancy

private void OnShutdown(EntityUid uid, IconSmoothComponent component, ComponentShutdown args)
{
Expand Down
16 changes: 16 additions & 0 deletions Content.Server/Gatherable/GatherableSystem.Projectile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Server.Gatherable.Components;
using Content.Shared.Mining.Components;
using Content.Shared.Projectiles;
using Robust.Shared.Physics.Events;

Expand All @@ -21,6 +22,21 @@ private void OnProjectileCollide(Entity<GatheringProjectileComponent> gathering,
return;
}

// Frontier: gathering changes
// bad gatherer - not strong enough
if (_whitelistSystem.IsWhitelistFail(gatherable.ToolWhitelist, gathering.Owner))
{
QueueDel(gathering);
return;
}
// Too strong (e.g. overpen) - gathers ore but destroys it
if (TryComp<OreVeinComponent>(args.OtherEntity, out var oreVein)
&& _whitelistSystem.IsWhitelistPass(oreVein.GatherDestructionWhitelist, gathering.Owner))
{
oreVein.PreventSpawning = true;
}
// End Frontier: gathering changes

Gather(args.OtherEntity, gathering, gatherable);
gathering.Comp.Amount--;

Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Mining/MiningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ private void OnDestruction(EntityUid uid, OreVeinComponent component, Destructio
if (component.CurrentOre == null)
return;

// Frontier
if (component.PreventSpawning)
return;
// End Frontier

var proto = _proto.Index<OrePrototype>(component.CurrentOre);

if (proto.OreEntity == null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server._NF.Gatherable.Components;

/// <summary>
/// Component denotes an item can be used to gather from hard rocks.
/// </summary>
[RegisterComponent]
public sealed partial class MiningGatheringHardComponent : Component;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server._NF.Gatherable.Components;

/// <summary>
/// Component denotes an item can be used to gather from softer rocks.
/// </summary>
[RegisterComponent]
public sealed partial class MiningGatheringSoftComponent : Component;
13 changes: 13 additions & 0 deletions Content.Shared/Mining/Components/OreVeinComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Random;
using Robust.Shared.Prototypes;
using Content.Shared.Whitelist; // Frontier

namespace Content.Shared.Mining.Components;

Expand Down Expand Up @@ -28,4 +29,16 @@ public sealed partial class OreVeinComponent : Component
/// </summary>
[DataField]
public ProtoId<OrePrototype>? CurrentOre;

/// <summary>
/// Frontier: if this ore is somehow "ruined", set this to true before destroying the entity.
/// </summary>
[DataField]
public bool PreventSpawning;

/// <summary>
/// Frontier: whitelist to check when gathering materials - these entities are too strong and ruin the ore.
/// </summary>
[DataField]
public EntityWhitelist? GatherDestructionWhitelist;
}
3 changes: 1 addition & 2 deletions Content.Shared/Weapons/Reflect/ReflectComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class ReflectComponent : Component
/// What we reflect.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("reflects")]
public ReflectType Reflects = ReflectType.Energy | ReflectType.NonEnergy | ReflectType.ShuttleKinetic; // Frontier: added ShuttleKinetic
public ReflectType Reflects = ReflectType.Energy | ReflectType.NonEnergy;

/// <summary>
/// Probability for a projectile to be reflected.
Expand All @@ -35,5 +35,4 @@ public enum ReflectType : byte
None = 0,
NonEnergy = 1 << 0,
Energy = 1 << 1,
ShuttleKinetic = 1 << 7, //Frontier: PTK-800
}
Loading
Loading