From 977bd5ad6dd1a6fe7a32721f296129cd3bb6bbce Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:39:25 +0000 Subject: [PATCH] make GameRule use entity category (#28294) --- .../Components/GameRuleComponent.cs | 3 +- Resources/Locale/en-US/entity-categories.ftl | 1 + Resources/Prototypes/Entities/categories.yml | 5 +++ .../Prototypes/GameRules/cargo_gifts.yml | 10 ------ Resources/Prototypes/GameRules/events.yml | 33 ------------------- Resources/Prototypes/GameRules/midround.yml | 1 - Resources/Prototypes/GameRules/roundstart.yml | 15 --------- Resources/Prototypes/GameRules/variation.yml | 8 ----- 8 files changed, 8 insertions(+), 68 deletions(-) diff --git a/Content.Server/GameTicking/Components/GameRuleComponent.cs b/Content.Server/GameTicking/Components/GameRuleComponent.cs index 1e6c3f0ab1..635452b3f3 100644 --- a/Content.Server/GameTicking/Components/GameRuleComponent.cs +++ b/Content.Server/GameTicking/Components/GameRuleComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Destructible.Thresholds; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.GameTicking.Components; @@ -7,7 +8,7 @@ namespace Content.Server.GameTicking.Components; /// Component attached to all gamerule entities. /// Used to both track the entity as well as store basic data /// -[RegisterComponent] +[RegisterComponent, EntityCategory("GameRules")] public sealed partial class GameRuleComponent : Component { /// diff --git a/Resources/Locale/en-US/entity-categories.ftl b/Resources/Locale/en-US/entity-categories.ftl index 190fe5713a..457397845d 100644 --- a/Resources/Locale/en-US/entity-categories.ftl +++ b/Resources/Locale/en-US/entity-categories.ftl @@ -1 +1,2 @@ entity-category-name-actions = Actions +entity-category-name-game-rules = Game Rules diff --git a/Resources/Prototypes/Entities/categories.yml b/Resources/Prototypes/Entities/categories.yml index 2fb56818f9..0535a8a4c2 100644 --- a/Resources/Prototypes/Entities/categories.yml +++ b/Resources/Prototypes/Entities/categories.yml @@ -2,3 +2,8 @@ id: Actions name: entity-category-name-actions hideSpawnMenu: true + +- type: entityCategory + id: GameRules + name: entity-category-name-game-rules + hideSpawnMenu: true diff --git a/Resources/Prototypes/GameRules/cargo_gifts.yml b/Resources/Prototypes/GameRules/cargo_gifts.yml index c5a5251297..ffc2ed404b 100644 --- a/Resources/Prototypes/GameRules/cargo_gifts.yml +++ b/Resources/Prototypes/GameRules/cargo_gifts.yml @@ -17,7 +17,6 @@ - type: entity id: GiftsPizzaPartySmall parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 5 @@ -35,7 +34,6 @@ - type: entity id: GiftsPizzaPartyLarge parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 2 @@ -53,7 +51,6 @@ - type: entity id: GiftsEngineering parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 5 @@ -74,7 +71,6 @@ - type: entity id: GiftsVendingRestock parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 4 @@ -95,7 +91,6 @@ - type: entity id: GiftsJanitor parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 6 @@ -113,7 +108,6 @@ - type: entity id: GiftsMedical parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 8 @@ -133,7 +127,6 @@ - type: entity id: GiftsSpacingSupplies parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 4 @@ -153,7 +146,6 @@ - type: entity id: GiftsFireProtection parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 4 @@ -171,7 +163,6 @@ - type: entity id: GiftsSecurityGuns parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 3 @@ -190,7 +181,6 @@ - type: entity id: GiftsSecurityRiot parent: CargoGiftsBase - noSpawn: true components: - type: StationEvent weight: 4 diff --git a/Resources/Prototypes/GameRules/events.yml b/Resources/Prototypes/GameRules/events.yml index 9f6e6a8125..f421cf6818 100644 --- a/Resources/Prototypes/GameRules/events.yml +++ b/Resources/Prototypes/GameRules/events.yml @@ -2,7 +2,6 @@ id: BaseStationEvent parent: BaseGameRule abstract: true - noSpawn: true components: - type: GameRule delay: @@ -13,7 +12,6 @@ id: BaseStationEventShortDelay parent: BaseGameRule abstract: true - noSpawn: true components: - type: GameRule delay: @@ -24,7 +22,6 @@ id: BaseStationEventLongDelay parent: BaseGameRule abstract: true - noSpawn: true components: - type: GameRule delay: @@ -34,7 +31,6 @@ - type: entity id: AnomalySpawn parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncementColor: "#18abf5" @@ -47,7 +43,6 @@ - type: entity id: BluespaceArtifact parent: BaseStationEventShortDelay - noSpawn: true components: - type: GameRule delay: @@ -64,7 +59,6 @@ - type: entity id: BluespaceLocker parent: BaseGameRule - noSpawn: true components: - type: StationEvent weight: 2 @@ -76,7 +70,6 @@ - type: entity id: BreakerFlip parent: BaseGameRule - noSpawn: true components: - type: StationEvent weight: 7 @@ -87,7 +80,6 @@ - type: entity id: BureaucraticError parent: BaseGameRule - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-bureaucratic-error-announcement @@ -99,7 +91,6 @@ - type: entity id: ClericalError parent: BaseGameRule - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-clerical-error-announcement @@ -111,7 +102,6 @@ - type: entity parent: BaseGameRule id: ClosetSkeleton - noSpawn: true components: - type: StationEvent weight: 5 @@ -123,7 +113,6 @@ - type: entity parent: BaseGameRule id: DragonSpawn - noSpawn: true components: - type: StationEvent weight: 6.5 @@ -153,7 +142,6 @@ - type: entity parent: BaseGameRule id: NinjaSpawn - noSpawn: true components: - type: StationEvent weight: 6 @@ -166,7 +154,6 @@ - type: entity parent: BaseGameRule id: RevenantSpawn - noSpawn: true components: - type: StationEvent weight: 7.5 @@ -180,7 +167,6 @@ #- type: entity # id: FalseAlarm # parent: BaseGameRule -# noSpawn: true # components: # - type: StationEvent # weight: 15 @@ -190,7 +176,6 @@ - type: entity id: GasLeak parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-gas-leak-start-announcement @@ -203,7 +188,6 @@ - type: entity id: KudzuGrowth parent: BaseStationEventLongDelay - noSpawn: true components: - type: StationEvent earliestStart: 15 @@ -215,7 +199,6 @@ - type: entity id: MeteorSwarm parent: BaseStationEventLongDelay - noSpawn: true components: - type: StationEvent earliestStart: 30 @@ -233,7 +216,6 @@ - type: entity id: MouseMigration parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-creatures-start-announcement @@ -259,7 +241,6 @@ - type: entity id: CockroachMigration parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-creatures-start-announcement @@ -277,7 +258,6 @@ - type: entity id: PowerGridCheck parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent weight: 5 @@ -294,7 +274,6 @@ - type: entity id: RandomSentience parent: BaseGameRule - noSpawn: true components: - type: StationEvent weight: 6 @@ -307,7 +286,6 @@ - type: entity parent: BaseGameRule id: SolarFlare - noSpawn: true components: - type: StationEvent weight: 8 @@ -336,7 +314,6 @@ - type: entity id: VentClog parent: BaseStationEventLongDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-clog-start-announcement @@ -351,7 +328,6 @@ - type: entity id: SlimesSpawn parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-creatures-start-announcement @@ -373,7 +349,6 @@ - type: entity id: SpiderSpawn parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-creatures-start-announcement @@ -391,7 +366,6 @@ - type: entity id: SpiderClownSpawn parent: BaseStationEventShortDelay - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-vent-creatures-start-announcement @@ -409,7 +383,6 @@ - type: entity id: ZombieOutbreak parent: BaseGameRule - noSpawn: true components: - type: StationEvent earliestStart: 50 @@ -441,7 +414,6 @@ prototype: InitialInfected - type: entity - noSpawn: true parent: BaseNukeopsRule id: LoneOpsSpawn components: @@ -475,7 +447,6 @@ prototype: Nukeops - type: entity - noSpawn: true parent: BaseTraitorRule id: SleeperAgentsRule components: @@ -501,7 +472,6 @@ - type: entity id: MassHallucinations parent: BaseGameRule - noSpawn: true components: - type: StationEvent weight: 7 @@ -518,7 +488,6 @@ - type: entity id: ImmovableRodSpawn parent: BaseGameRule - noSpawn: true components: - type: StationEvent startAnnouncement: station-event-immovable-rod-start-announcement @@ -556,7 +525,6 @@ orGroup: rodProto - type: entity - noSpawn: true parent: BaseGameRule id: IonStorm components: @@ -569,7 +537,6 @@ - type: entity id: MimicVendorRule parent: BaseGameRule - noSpawn: true components: - type: StationEvent earliestStart: 0 diff --git a/Resources/Prototypes/GameRules/midround.yml b/Resources/Prototypes/GameRules/midround.yml index fe5af117e6..c190b0333a 100644 --- a/Resources/Prototypes/GameRules/midround.yml +++ b/Resources/Prototypes/GameRules/midround.yml @@ -18,7 +18,6 @@ threats: NinjaThreats - type: entity - noSpawn: true parent: BaseGameRule id: Thief components: diff --git a/Resources/Prototypes/GameRules/roundstart.yml b/Resources/Prototypes/GameRules/roundstart.yml index cf2c5b2f47..3493749457 100644 --- a/Resources/Prototypes/GameRules/roundstart.yml +++ b/Resources/Prototypes/GameRules/roundstart.yml @@ -1,12 +1,10 @@ - type: entity id: BaseGameRule abstract: true - noSpawn: true components: - type: GameRule - type: entity - noSpawn: true parent: BaseGameRule id: RespawnDeadRule components: @@ -17,7 +15,6 @@ deleteBody: false - type: entity - noSpawn: true parent: BaseGameRule id: SubGamemodesRule components: @@ -29,7 +26,6 @@ - type: entity id: DeathMatch31 parent: BaseGameRule - noSpawn: true components: - type: DeathMatchRule rewardSpawns: @@ -59,7 +55,6 @@ - type: entity id: InactivityTimeRestart parent: BaseGameRule - noSpawn: true components: - type: InactivityRule inactivityMaxTime: 600 @@ -68,7 +63,6 @@ - type: entity id: MaxTimeRestart parent: BaseGameRule - noSpawn: true components: - type: MaxTimeRestartRule roundMaxTime: 300 @@ -88,7 +82,6 @@ - type: AntagLoadProfileRule - type: entity - noSpawn: true parent: BaseNukeopsRule id: Nukeops components: @@ -166,7 +159,6 @@ agentName: traitor-round-end-agent-name - type: entity - noSpawn: true parent: BaseTraitorRule id: Traitor components: @@ -188,7 +180,6 @@ - type: entity id: Revolutionary parent: BaseGameRule - noSpawn: true components: - type: GameRule minPlayers: 15 @@ -213,21 +204,18 @@ - type: entity id: Sandbox parent: BaseGameRule - noSpawn: true components: - type: SandboxRule - type: entity id: Secret parent: BaseGameRule - noSpawn: true components: - type: SecretRule - type: entity id: Zombie parent: BaseGameRule - noSpawn: true components: - type: GameRule minPlayers: 20 @@ -260,14 +248,12 @@ - type: entity id: BasicStationEventScheduler parent: BaseGameRule - noSpawn: true components: - type: BasicStationEventScheduler - type: entity id: RampingStationEventScheduler parent: BaseGameRule - noSpawn: true components: - type: RampingStationEventScheduler @@ -275,7 +261,6 @@ - type: entity id: BasicRoundstartVariation parent: BaseGameRule - noSpawn: true components: - type: RoundstartStationVariationRule rules: diff --git a/Resources/Prototypes/GameRules/variation.yml b/Resources/Prototypes/GameRules/variation.yml index 2884d5f9d6..093a832d72 100644 --- a/Resources/Prototypes/GameRules/variation.yml +++ b/Resources/Prototypes/GameRules/variation.yml @@ -4,7 +4,6 @@ id: BaseVariationPass parent: BaseGameRule abstract: true - noSpawn: true components: - type: StationVariationPassRule @@ -13,14 +12,12 @@ - type: entity id: BasicPoweredLightVariationPass parent: BaseVariationPass - noSpawn: true components: - type: PoweredLightVariationPass - type: entity id: SolidWallRustingVariationPass parent: BaseVariationPass - noSpawn: true components: - type: WallReplaceVariationPass - type: EntityReplaceVariationPass @@ -32,7 +29,6 @@ - type: entity id: ReinforcedWallRustingVariationPass parent: BaseVariationPass - noSpawn: true components: - type: ReinforcedWallReplaceVariationPass - type: EntityReplaceVariationPass @@ -44,7 +40,6 @@ - type: entity id: BasicTrashVariationPass parent: BaseVariationPass - noSpawn: true components: - type: EntitySpawnVariationPass tilesPerEntityAverage: 35 @@ -105,7 +100,6 @@ - type: entity id: BasicPuddleMessVariationPass parent: BaseVariationPass - noSpawn: true components: - type: PuddleMessVariationPass randomPuddleSolutionFill: RandomFillTrashPuddle @@ -113,7 +107,6 @@ - type: entity id: BloodbathPuddleMessVariationPass parent: BaseVariationPass - noSpawn: true components: - type: PuddleMessVariationPass tilesPerSpillAverage: 150 @@ -123,7 +116,6 @@ - type: entity id: CutWireVariationPass parent: BaseVariationPass - noSpawn: true components: - type: CutWireVariationPass wireCutChance: 0.01 -- 2.51.2