adapt codebase

This commit is contained in:
Ed
2025-08-25 17:00:57 +03:00
parent b8b17f7b8a
commit b13769a82c
33 changed files with 33 additions and 165 deletions

View File

@@ -10,7 +10,6 @@ using Content.Shared._CP14.Cooking.Components;
using Content.Shared.DisplacementMap;
using Content.Shared.Rounding;
using Robust.Client.GameObjects;
using Robust.Shared.Random;
namespace Content.Client._CP14.Cooking;

View File

@@ -1,5 +1,6 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared._CP14.FarSound;
using Content.Shared.Trigger;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;

View File

@@ -5,6 +5,7 @@ using Content.Server.Shuttles.Events;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -42,13 +43,8 @@ public sealed class CP14CrashingShipRule : GameRuleSystem<CP14CrashingShipRuleCo
base.Started(uid, component, gameRule, args);
var station = _station.GetStations().First();
if (!TryComp<StationDataComponent>(station, out var stationData))
{
_sawmill.Error($"Station {station} does not have a StationDataComponent.");
return;
}
var largestStationGrid = _station.GetLargestGrid(stationData);
var largestStationGrid = _station.GetLargestGrid(station);
if (largestStationGrid is null)
{

View File

@@ -5,9 +5,9 @@ using Content.Server._CP14.Procedural;
using Content.Server.GameTicking.Rules;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Systems;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Robust.Shared.Map;
namespace Content.Server._CP14.GameTicking.Rules;
@@ -36,13 +36,7 @@ public sealed class CP14ExpeditionToWindlandsRule : GameRuleSystem<CP14Expeditio
base.Started(uid, component, gameRule, args);
var station = _station.GetStations().First();
if (!TryComp<StationDataComponent>(station, out var stationData))
{
_sawmill.Error($"Station {station} does not have a StationDataComponent.");
return;
}
var largestStationGrid = _station.GetLargestGrid(stationData);
var largestStationGrid = _station.GetLargestGrid(station);
if (largestStationGrid is null)
{

View File

@@ -1,28 +1,7 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared._CP14.MagicEnergy;
using Content.Shared._CP14.MagicWeakness;
namespace Content.Server._CP14.MagicWeakness;
public class CP14MagicWeaknessSystem : CP14SharedMagicWeaknessSystem
{
[Dependency] private readonly TriggerSystem _trigger = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14MagicUnsafeTriggerComponent, CP14MagicEnergyBurnOutEvent>(OnMagicEnergyBurnOutTrigger);
SubscribeLocalEvent<CP14MagicUnsafeTriggerComponent, CP14MagicEnergyOverloadEvent>(OnMagicEnergyOverloadTrigger);
}
private void OnMagicEnergyOverloadTrigger(Entity<CP14MagicUnsafeTriggerComponent> ent, ref CP14MagicEnergyOverloadEvent args)
{
_trigger.Trigger(ent);
}
private void OnMagicEnergyBurnOutTrigger(Entity<CP14MagicUnsafeTriggerComponent> ent, ref CP14MagicEnergyBurnOutEvent args)
{
_trigger.Trigger(ent);
}
}

View File

@@ -1,28 +0,0 @@
using Content.Shared._CP14.ModularCraft;
using Content.Shared._CP14.ModularCraft.Components;
using Content.Shared.Damage;
using Content.Shared.Wieldable.Components;
namespace Content.Server._CP14.ModularCraft.Modifiers;
public sealed partial class EditIncreaseDamageOnWield : CP14ModularCraftModifier
{
[DataField]
public DamageSpecifier? BonusDamage;
[DataField]
public float? DamageMultiplier;
public override void Effect(EntityManager entManager, Entity<CP14ModularCraftStartPointComponent> start, Entity<CP14ModularCraftPartComponent>? part)
{
if (!entManager.TryGetComponent<IncreaseDamageOnWieldComponent>(start, out var wield))
return;
if (BonusDamage is not null)
wield.BonusDamage += BonusDamage;
if (DamageMultiplier is not null)
wield.BonusDamage *= DamageMultiplier.Value;
}
}

View File

@@ -4,6 +4,7 @@ using Content.Server.GameTicking;
using Content.Shared.Ghost;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Trigger;
using MyNamespace;
using Robust.Shared.Random;

View File

@@ -2,7 +2,6 @@ using System.Threading;
using Content.Server._CP14.Demiplane;
using Content.Server._CP14.Procedural.GlobalWorld.Components;
using Content.Server.Procedural;
using Content.Server.Station.Components;
using Content.Server.Station.Events;
using Content.Server.Station.Systems;
using Content.Shared._CP14.Procedural.Prototypes;
@@ -42,13 +41,7 @@ public sealed class CP14LocationGenerationSystem : EntitySystem
private void OnStationPostInit(Entity<CP14StationProceduralLocationComponent> ent, ref StationPostInitEvent args)
{
if (!TryComp<StationDataComponent>(ent, out var stationData))
{
_sawmill.Error($"Station {ent} does not have a StationDataComponent, cannot generate location on it.");
return;
}
var largestStationGrid = _station.GetLargestGrid(stationData);
var largestStationGrid = _station.GetLargestGrid(ent.Owner);
if (largestStationGrid is null)
{

View File

@@ -9,6 +9,7 @@ using Content.Shared._CP14.Religion.Systems;
using Content.Shared.Chat;
using Content.Shared.Eye;
using Content.Shared.FixedPoint;
using Content.Shared.Speech;
using Robust.Server.GameObjects;
using Robust.Server.GameStates;
using Robust.Shared.Network;

View File

@@ -1,4 +1,4 @@
using Content.Shared.Roles;
using Content.Shared.Roles.Components;
namespace Content.Server._CP14.Roles;

View File

@@ -35,14 +35,7 @@ public sealed partial class CP14StationZLevelsSystem : EntitySystem
if (ent.Comp.Initialized)
return;
if (!TryComp(ent, out StationDataComponent? dataComp))
{
Log.Error($"Failed to init CP14StationZLevelsSystem: no StationData");
return;
}
var defaultMap = _station.GetLargestGrid(dataComp);
var defaultMap = _station.GetLargestGrid(ent.Owner);
if (defaultMap is null)
{
Log.Error($"Failed to init CP14StationZLevelsSystem: defaultMap is null");

View File

@@ -27,7 +27,7 @@ public abstract class SharedChatSystem : EntitySystem
public const int VoiceRange = 10; // how far voice goes in world units
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
public const int WhisperMuffledRange = 5; // how far whisper goes at all, in world units
public const string DefaultAnnouncementSound = "/Audio/Announcements/announce.ogg";
public const string DefaultAnnouncementSound = "/Audio/_CP14/Announce/event_boom.ogg"; //CP14 replaced default announce sound
public static readonly ProtoId<RadioChannelPrototype> CommonChannel = "Common";

View File

@@ -45,6 +45,7 @@ public sealed partial class TriggerSystem : EntitySystem
{
base.Initialize();
InitializeDamageReceived(); //CP14
InitializeCollide();
InitializeCondition();
InitializeInteraction();

View File

@@ -12,7 +12,7 @@ namespace Content.Shared._CP14.Cooking.Components;
/// <summary>
/// Food of the specified type can be transferred to this entity.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), Access(typeof(CP14SharedCookingSystem))]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true, raiseAfterAutoHandleState: true), Access(typeof(CP14SharedCookingSystem))]
public sealed partial class CP14FoodHolderComponent : Component
{
/// <summary>

View File

@@ -1,7 +1,7 @@
namespace Content.Server.Explosion.Components;
namespace Content.Shared._CP14.Explosion.Components;
/// <summary>
/// Triggers when the entity is damaged.
/// </summary>
[RegisterComponent]
public sealed partial class CP14TriggerOnDamageReceivedComponent : Component { }
public sealed partial class CP14TriggerOnDamageReceivedComponent : Component;

View File

@@ -1,7 +1,7 @@
using Content.Server.Explosion.Components;
using Content.Shared._CP14.Explosion.Components;
using Content.Shared.Damage;
namespace Content.Server.Explosion.EntitySystems;
namespace Content.Shared.Trigger.Systems;
public sealed partial class TriggerSystem
{

View File

@@ -4,6 +4,7 @@ using Content.Shared.Damage;
using Content.Shared.IdentityManagement;
using Content.Shared.Popups;
using Content.Shared.StatusEffectNew;
using Content.Shared.Trigger.Systems;
namespace Content.Shared._CP14.MagicWeakness;
@@ -12,6 +13,7 @@ public abstract class CP14SharedMagicWeaknessSystem : EntitySystem
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly TriggerSystem _trigger = default!;
public override void Initialize()
{
@@ -22,6 +24,9 @@ public abstract class CP14SharedMagicWeaknessSystem : EntitySystem
SubscribeLocalEvent<CP14MagicUnsafeSleepComponent, CP14MagicEnergyBurnOutEvent>(OnMagicEnergyBurnOutSleep);
SubscribeLocalEvent<CP14MagicUnsafeSleepComponent, CP14MagicEnergyOverloadEvent>(OnMagicEnergyOverloadSleep);
SubscribeLocalEvent<CP14MagicUnsafeTriggerComponent, CP14MagicEnergyBurnOutEvent>(OnMagicEnergyBurnOutTrigger);
SubscribeLocalEvent<CP14MagicUnsafeTriggerComponent, CP14MagicEnergyOverloadEvent>(OnMagicEnergyOverloadTrigger);
}
private void OnMagicEnergyBurnOutSleep(Entity<CP14MagicUnsafeSleepComponent> ent,
@@ -56,6 +61,16 @@ public abstract class CP14SharedMagicWeaknessSystem : EntitySystem
}
}
private void OnMagicEnergyOverloadTrigger(Entity<CP14MagicUnsafeTriggerComponent> ent, ref CP14MagicEnergyOverloadEvent args)
{
_trigger.Trigger(ent);
}
private void OnMagicEnergyBurnOutTrigger(Entity<CP14MagicUnsafeTriggerComponent> ent, ref CP14MagicEnergyBurnOutEvent args)
{
_trigger.Trigger(ent);
}
private void OnMagicEnergyBurnOutDamage(Entity<CP14MagicUnsafeDamageComponent> ent,
ref CP14MagicEnergyBurnOutEvent args)
{

View File

@@ -86,7 +86,7 @@
slipData:
launchForwardsMultiplier: 0
- type: TriggerOnStepTrigger
- type: DamageUserOnTrigger
- type: DamageOnTrigger
damage:
types:
Slash: 10

View File

@@ -17,11 +17,6 @@
types:
Slash: 14
Piercing: 3
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Slash: 11
Piercing: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1
@@ -102,10 +97,6 @@
bonusDamage:
types:
Blunt: 1
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 1
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -7,8 +7,6 @@
sharpnessDamageMultiplier: 3
- !type:EditMeleeWeapon
damageMultiplier: 0.75
- !type:EditIncreaseDamageOnWield
damageMultiplier: 0.75
- type: modularPart
id: BaseBladeWooden
@@ -19,8 +17,6 @@
sharpnessDamageMultiplier: 3
- !type:EditMeleeWeapon
damageMultiplier: 0.25
- !type:EditIncreaseDamageOnWield
damageMultiplier: 0.25
- type: modularPart
id: BaseBladeIron
@@ -55,6 +51,4 @@
sharpnessDamageMultiplier: 0.80
- !type:EditMeleeWeapon
damageMultiplier: 1.25
- !type:EditIncreaseDamageOnWield
damageMultiplier: 1.25

View File

@@ -24,10 +24,6 @@
types:
Slash: 4
Piercing: 3
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -34,10 +34,6 @@
bonusDamage:
types:
Blunt: 7
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 5
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -33,10 +33,6 @@
bonusDamage:
types:
Piercing: 6
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 3
- !type:EditDamageableModifier # Improvised weapon
multiplier: 1.2
- !type:EditItem

View File

@@ -16,11 +16,6 @@
types:
Blunt: 5
Piercing: 2
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 8
Piercing: 4
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -20,10 +20,6 @@
bonusDamage:
types:
Blunt: 5
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 5
- !type:EditDamageableModifier # Improvised weapon
multiplier: 1.2
- !type:EditItem

View File

@@ -24,11 +24,6 @@
types:
Piercing: 10
Structural: 4
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 6
Structural: 17
- !type:EditItem
newSize: Normal
adjustShape: 1, 1

View File

@@ -22,11 +22,6 @@
types:
Slash: 3
Blunt: 3
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Slash: 1
Blunt: 3
- !type:EditDamageableModifier # Improvised weapon
multiplier: 1.2
- !type:EditItem

View File

@@ -13,10 +13,6 @@
bonusDamage:
types:
Slash: 5
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Slash: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -22,10 +22,6 @@
bonusDamage:
types:
Slash: 8
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Slash: 16
- !type:EditItem
newSize: Large
adjustShape: 0, 2

View File

@@ -30,10 +30,6 @@
bonusDamage:
types:
Piercing: 8
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1
@@ -128,10 +124,6 @@
bonusDamage:
types:
Blunt: 1
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 1
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -23,11 +23,6 @@
types:
Slash: 9
Piercing: 5
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Slash: 5
Piercing: 2
- !type:EditItem
newSize: Large
adjustShape: 0, 2
@@ -123,10 +118,6 @@
bonusDamage:
types:
Blunt: 1
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Blunt: 1
- !type:EditItem
newSize: Large
adjustShape: 0, 2

View File

@@ -10,8 +10,6 @@
sharpnessDamageMultiplier: 0.8
- !type:EditMeleeWeapon
damageMultiplier: 1.2
- !type:EditIncreaseDamageOnWield
damageMultiplier: 1.2
- type: modularPart
id: GardeGuildmaster

View File

@@ -6,8 +6,6 @@
modifiers:
- !type:EditMeleeWeapon
damageMultiplier: 1.2
- !type:EditIncreaseDamageOnWield
damageMultiplier: 1.2
- type: modularPart
id: GardeSharpIron
@@ -64,5 +62,3 @@
modifiers:
- !type:EditMeleeWeapon
damageMultiplier: 1.1
- !type:EditIncreaseDamageOnWield
damageMultiplier: 1.0