Skip to content

Commit

Permalink
GiftsGamma event fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirus59 committed Aug 11, 2024
1 parent 77b6152 commit 70ec3ca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
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
24 changes: 14 additions & 10 deletions Resources/Prototypes/GameRules/cargo_gifts.yml
Original file line number Diff line number Diff line change
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

0 comments on commit 70ec3ca

Please sign in to comment.