Skip to content

Commit

Permalink
make random sentience a glimmer event + fix glimmer events not existi…
Browse files Browse the repository at this point in the history
…ng (#1834)

* add MaxSpawns to GlimmerMobRule

* remove defunct nyano event code

* add glimmer event scheduler and fix events

* add glimmer event scheduler to all presets

* typo ops

Signed-off-by: deltanedas <[email protected]>

---------

Signed-off-by: deltanedas <[email protected]>
Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Sep 17, 2024
1 parent 137eccc commit d98fbbe
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public sealed partial class GlimmerMobRuleComponent : Component
[DataField(required: true)]
public EntProtoId MobPrototype = string.Empty;

/// <summary>
/// Hard cap on spawns, regardless of glimmer or psionics.
/// </summary>
[DataField]
public int? MaxSpawns;

/// <summary>
/// Every this number of psionics spawns 1 mob.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ protected override void Started(EntityUid uid, GlimmerMobRuleComponent comp, Gam
int multiplier = Math.Max(1, (int) _glimmer.GetGlimmerTier() - (int) comp.GlimmerTier);

var total = baseCount * multiplier;
if (comp.MaxSpawns is {} maxSpawns)
total = Math.Min(total, maxSpawns);

Log.Info($"Spawning {total} of {comp.MobPrototype} from {ToPrettyString(uid):rule}");
for (var i = 0; i < total; i++)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

43 changes: 43 additions & 0 deletions Resources/Prototypes/DeltaV/GameRules/glimmer_events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
- type: entityTable
id: GlimmerEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp and GlimmerEventComp
children:
- id: MundaneDischarge
- id: NoosphericZap
- id: NoosphericFry
- id: PsionicCatGotYourTongue
- id: MassMindSwap
- id: GlimmerWispSpawn
- id: FreeProber
- id: GlimmerRevenantSpawn
- id: GlimmerMiteSpawn
- id: GlimmerRandomSentience

- type: entity
parent: BaseGameRule
id: GlimmerEventScheduler
components:
- type: BasicStationEventScheduler
minMaxEventTiming:
min: 300
max: 1500
scheduledGameRules: !type:NestedSelector
tableId: GlimmerEventsTable

# Like upstream's event but can reoccur and tied to glimmer.
- type: entity
parent: [RandomSentience, BaseGlimmerEvent]
id: GlimmerRandomSentience
components:
- type: StationEvent
weight: 6
duration: 1
reoccurrenceDelay: 20
startAudio:
path: /Audio/Announcements/attention.ogg
- type: GlimmerEvent
minimumGlimmer: 300
maximumGlimmer: 600
glimmerBurnLower: 20
glimmerBurnUpper: 60
- type: RandomSentienceRule
2 changes: 1 addition & 1 deletion Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#- id: MimicVendorRule # DeltaV - disabled, see below
- id: MouseMigration
- id: PowerGridCheck
- id: RandomSentience
#- id: RandomSentience # DeltaV - replaced with RandomSentienceGlimmer
- id: SlimesSpawn
- id: SolarFlare
- id: SpiderClownSpawn
Expand Down
14 changes: 4 additions & 10 deletions Resources/Prototypes/Nyanotrasen/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,17 @@
components:
- type: FreeProberRule

## converted upstream events
- type: entity
parent: BaseGlimmerSignaturesEvent
id: GlimmerRandomSentience
components:
- type: GlimmerEvent
maximumGlimmer: 600
- type: GlimmerRandomSentienceRule

# Converted from upstream event
- type: entity
parent: BaseGlimmerSignaturesEvent
id: GlimmerRevenantSpawn
components:
- type: GlimmerEvent
minimumGlimmer: 500
maximumGlimmer: 900
- type: GlimmerRevenantRule
- type: GlimmerMobRule
mobPrototype: MobRevenant
maxSpawns: 1

- type: entity
parent: BaseGlimmerSignaturesEvent
Expand Down
13 changes: 13 additions & 0 deletions Resources/Prototypes/game_presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- SpaceTrafficControlEventScheduler
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: KesslerSyndrome
Expand All @@ -26,6 +27,7 @@
- RampingStationEventScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: AllAtOnce
Expand All @@ -43,6 +45,7 @@
- RampingStationEventScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: AllerAtOnce
Expand All @@ -67,6 +70,7 @@
- SpaceTrafficControlEventScheduler
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Extended
Expand All @@ -81,6 +85,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Greenshift
Expand All @@ -93,6 +98,7 @@
rules:
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Secret
Expand All @@ -117,6 +123,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: SecretGreenshift #For Admin Use: Runs Greenshift but shows "Secret" in lobby.
Expand All @@ -128,6 +135,7 @@
rules:
- SpaceTrafficControlFriendlyEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Sandbox
Expand Down Expand Up @@ -155,6 +163,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Deathmatch
Expand Down Expand Up @@ -183,6 +192,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Revolutionary
Expand All @@ -200,6 +210,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Zombie
Expand All @@ -218,6 +229,7 @@
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

- type: gamePreset
id: Zombieteors
Expand All @@ -234,3 +246,4 @@
- KesslerSyndromeScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation
- GlimmerEventScheduler # DeltaV

0 comments on commit d98fbbe

Please sign in to comment.