Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ngines into Update-Submodule-218.2.0
  • Loading branch information
DEATHB4DEFEAT committed Jul 12, 2024
2 parents 090ec15 + 4634419 commit d503727
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
[RegisterComponent, Access(typeof(RampingStationEventSchedulerSystem))]
public sealed partial class RampingStationEventSchedulerComponent : Component
{
/// <summary>
/// The maximum number by which the event rate will be multiplied when shift time reaches the end time.
/// </summary>
[DataField]
public float ChaosModifier = 3f;

/// <summary>
/// The minimum number by which the event rate will be multiplied when the shift has just begun.
/// </summary>
[DataField]
public float StartingChaosRatio = 0.1f;

/// <summary>
/// The number by which all event delays will be multiplied. Unlike chaos, remains constant throughout the shift.
/// </summary>
[DataField]
public float EventDelayModifier = 1f;

/// <summary>
/// The number by which average expected shift length is multiplied. Higher values lead to slower chaos growth.
/// </summary>
public float ShiftLengthModifier = 1f;

// Everything below is overridden in the RampingStationEventSchedulerSystem based on CVars
[DataField("endTime"), ViewVariables(VVAccess.ReadWrite)]
public float EndTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ protected override void Started(EntityUid uid, RampingStationEventSchedulerCompo
{
base.Started(uid, component, gameRule, args);

var avgChaos = _cfg.GetCVar(CCVars.EventsRampingAverageChaos);
var avgTime = _cfg.GetCVar(CCVars.EventsRampingAverageEndTime);
var avgChaos = _cfg.GetCVar(CCVars.EventsRampingAverageChaos) * component.ChaosModifier;
var avgTime = _cfg.GetCVar(CCVars.EventsRampingAverageEndTime) * component.ShiftLengthModifier;

// Worlds shittiest probability distribution
// Got a complaint? Send them to
component.MaxChaos = _random.NextFloat(avgChaos - avgChaos / 4, avgChaos + avgChaos / 4);
component.MaxChaos = avgChaos * _random.NextFloat(0.75f, 1.25f);
// This is in minutes, so *60 for seconds (for the chaos calc)
component.EndTime = _random.NextFloat(avgTime - avgTime / 4, avgTime + avgTime / 4) * 60f;
component.StartingChaos = component.MaxChaos / 10;
component.EndTime = avgTime * _random.NextFloat(0.75f, 1.25f) * 60f;
component.StartingChaos = component.MaxChaos * component.StartingChaosRatio;

PickNextEventTime(uid, component);
}
Expand Down Expand Up @@ -68,9 +68,10 @@ public override void Update(float frameTime)

private void PickNextEventTime(EntityUid uid, RampingStationEventSchedulerComponent component)
{
var mod = GetChaosModifier(uid, component);
component.TimeUntilNextEvent = _random.NextFloat(
_cfg.GetCVar(CCVars.GameEventsRampingMinimumTime),
_cfg.GetCVar(CCVars.GameEventsRampingMaximumTime));

component.TimeUntilNextEvent = _random.NextFloat(_cfg.GetCVar(CCVars.GameEventsRampingMinimumTime) / mod,
_cfg.GetCVar(CCVars.GameEventsRampingMaximumTime)) / mod;
component.TimeUntilNextEvent *= component.EventDelayModifier / GetChaosModifier(uid, component);
}
}
18 changes: 18 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4393,3 +4393,21 @@ Entries:
Intercom, FireAlarm and Substation)
id: 6150
time: '2024-07-09T19:37:03.0000000+00:00'
- author: CodedCrow
changes:
- type: Add
message: Plushie
id: 6151
time: '2024-07-11T17:23:58.0000000+00:00'
- author: osjarw
changes:
- type: Add
message: Wallmount substation electronics can now be created at an autolathe.
id: 6152
time: '2024-07-11T17:24:30.0000000+00:00'
- author: Mnemotechnician
changes:
- type: Tweak
message: 'Players can now vote on two more gamemodes: Traitors and Hellshift.'
id: 6153
time: '2024-07-11T17:26:41.0000000+00:00'
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
survival-title = Survival
survival-description = No internal threats, but how long can the station survive increasingly chaotic and frequent events?
hellshift-title = Hellshift
hellshift-description = The station rolled a "one" in a luck check. Can the crew make it to the end?
1 change: 1 addition & 0 deletions Resources/Prototypes/Catalog/Fills/Crates/fun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
amount: 2
- id: PlushieArachind
- id: PlushiePenguin
- id: PlushieArachne

- type: entity
id: CrateFunLizardPlushieBulk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- PlushieMoth
- PlushieMothRandom # Nyanotrasen Random Moth Plushies
- PlushieArachind
- PlushieArachne
chance: 0.5
offset: 0.2

Expand Down
28 changes: 28 additions & 0 deletions Resources/Prototypes/Entities/Objects/Fun/toys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,34 @@
sound:
path: /Audio/Voice/Human/malescream_5.ogg

- type: entity
parent: BasePlushie
id: PlushieArachne
name: Arachne plushie
description: A plushie of an Arachne, a half human, half spider creature. Why does it look familiar?
components:
- type: Sprite
state: plushie_arachne
- type: EmitSoundOnUse
sound:
path: /Audio/Voice/Human/womanlaugh.ogg
- type: EmitSoundOnLand
sound:
path: /Audio/Voice/Human/female_sigh.ogg
- type: EmitSoundOnActivate
sound:
path: /Audio/Voice/Human/womanlaugh.ogg
- type: Food
requiresSpecialDigestion: true
useSound:
path: /Audio/Voice/Human/femalescream_4.ogg
- type: MeleeWeapon
soundHit:
path: /Audio/Voice/Human/femalescream_2.ogg
- type: EmitSoundOnTrigger
sound:
path: /Audio/Voice/Human/femalescream_5.ogg

- type: entity
parent: BasePlushie
id: PlushieMoth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
- APCElectronics
- SMESMachineCircuitboard
- SubstationMachineCircuitboard
- WallmountSubstationElectronics
- CellRechargerCircuitboard
- BorgChargerCircuitboard
- WeaponCapacitorRechargerCircuitboard
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/Entities/Structures/Power/substation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@
- type: Battery
maxCharge: 2000000
startingCharge: 2000000
- type: ContainerFill
containers:
board: [ WallmountSubstationElectronics ]
capacitor: [ CapacitorStockPart ]
powercell: [ PowerCellSmall ]
- type: ContainerContainer
containers:
board: !type:Container
capacitor: !type:Container
powercell: !type:Container

# Construction Frame
- type: entity
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@
components:
- type: RampingStationEventScheduler

- type: entity
id: HellshiftStationEventScheduler
parent: BaseGameRule
noSpawn: true
components:
- type: RampingStationEventScheduler
chaosModifier: 4 # By default, one event each 30-10 seconds after two hours. Changing CVars will cause this to deviate.
startingChaosRatio: 0.025 # Starts as slow as survival, but quickly ramps up
shiftLengthModifier: 2.5

# variation passes
- type: entity
id: BasicRoundstartVariation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
steps:
- material: Cable
amount: 5
doAfter: 2
doAfter: 0.5
- material: CableMV
amount: 5
doAfter: 0.5
- material: CableHV
amount: 5
doAfter: 0.5
- tool: Screwing
doAfter: 2

Expand All @@ -41,12 +47,34 @@
icon:
sprite: "Objects/Misc/module.rsi"
state: "charger_APC"
doAfter: 1
doAfter: 0.5
- anyTags:
- PowerCell
- PowerCellSmall
store: powercell
name: a powercell
icon:
sprite: "Objects/Power/power_cells.rsi"
state: "medium"
doAfter: 0.5
- tag: CapacitorStockPart
name: a capacitor
store: capacitor
icon:
sprite: "Objects/Misc/stock_parts.rsi"
state: "capacitor"
doAfter: 0.5
- to: frame
completed:
- !type:GivePrototype
prototype: CableApcStack1
amount: 5
- !type:GivePrototype
prototype: CableMVStack1
amount: 5
- !type:GivePrototype
prototype: CableHVStack1
amount: 5
steps:
- tool: Cutting
doAfter: 1
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Recipes/Lathes/electronics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
completetime: 4
materials:
Steel: 50
Glass: 350
Glass: 450

- type: latheRecipe
id: SMESMachineCircuitboard
Expand Down
13 changes: 12 additions & 1 deletion Resources/Prototypes/game_presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
- RampingStationEventScheduler
- BasicRoundstartVariation

- type: gamePreset
id: SurvivalHellshift
alias:
- hellshift
showInVote: true
name: hellshift-title
description: hellshift-description
rules:
- HellshiftStationEventScheduler
- BasicRoundstartVariation

- type: gamePreset
id: AllAtOnce
name: all-at-once-title
Expand Down Expand Up @@ -90,7 +101,7 @@
- traitor
name: traitor-title
description: traitor-description
showInVote: false
showInVote: true
rules:
- Traitor
- SubGamemodesRule
Expand Down
3 changes: 3 additions & 0 deletions Resources/Textures/Objects/Fun/toys.rsi/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
{
"name": "plushie_diona"
},
{
"name": "plushie_arachne"
},
{
"name": "plushie_human"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d503727

Please sign in to comment.