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

GiftsGamma event fix #1573

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@ public sealed partial class StationEventComponent : Component
/// </summary>
[DataField]
public bool OccursDuringRoundEnd = true;

//SS220 GiftsGamma event fix begin
/// <summary>
/// If true, the event isn't triggered randomly in round
/// </summary>
[DataField]
public bool CannotStartRandomly = false;
//SS220 GiftsGamma event fix end
}
5 changes: 5 additions & 0 deletions Content.Server/StationEvents/EventManagerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ private bool CanRun(EntityPrototype prototype, StationEventComponent stationEven
if (GameTicker.IsGameRuleActive(prototype.ID))
return false;

//SS220 GiftsGamma event fix begin
if (stationEvent.CannotStartRandomly)
return false;
//SS220 GiftsGamma event fix end

if (stationEvent.MaxOccurrences.HasValue && GetOccurrences(prototype) >= stationEvent.MaxOccurrences.Value)
{
return false;
Expand Down
26 changes: 15 additions & 11 deletions Resources/Prototypes/GameRules/cargo_gifts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
min: 10
max: 10
- type: StationEvent
startColor: "#18abf5"
startAnnouncementColor: "#18abf5" #SS220 CargoGifts events color fix
startAudio:
path: /Audio/Announcements/announce.ogg
- type: CargoGiftsRule
Expand Down Expand Up @@ -198,16 +198,20 @@
#ss220-gamma
- type: entity
id: GiftsGamma
parent: BaseGameRule
parent: CargoGiftsBase #SS220 GiftsGamma event fix
categories: [ GameRules ]
components:
- type: CargoGiftsRule
description: cargo-gift-dest-gamma
sender: cargo-gift-default-sender
dest: cargo-gift-dest-all
gifts:
SecurityArmor: 2
SecurityHelmet: 2
ArmorySmg: 3
ArmoryShotgun: 3
#SS220 GiftsGamma event fix begin
- type: StationEvent
cannotStartRandomly: true
#SS220 GiftsGamma event fix end
- type: CargoGiftsRule
description: cargo-gift-dest-gamma
sender: cargo-gift-default-sender
dest: cargo-gift-dest-all
gifts:
SecurityArmor: 2
SecurityHelmet: 2
ArmorySmg: 3
ArmoryShotgun: 3
#ss220-gammaend
Loading