Skip to content

Commit

Permalink
SvS event fixes, enable SvS in secret rotation....scary
Browse files Browse the repository at this point in the history
  • Loading branch information
V authored and V committed Sep 6, 2024
1 parent 65928ba commit 158b49d
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Objectives/Systems/KeepAliveCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void OnAssigned(EntityUid uid, RandomTraitorAliveComponent comp, ref Obj
return;
}

//Fallback to assign people who COULD be assigned as traitor
//Fallback to assign people who COULD be assigned as traitor - might need to just do this from the start on ForceAll rounds, limiting it to existing traitors could be skewing the numbers towards just a few people.
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
var allValidTraitorCandidates = new List<EntityUid>();
if (_traitorRule.CurrentAntagPool != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void OnTraitorAssigned(EntityUid uid, PickRandomTraitorComponent comp, r
return;
}

//Fallback to assign people who COULD be assigned as traitor
//Fallback to assign people who COULD be assigned as traitor - might need to just do this from the start on ForceAll rounds, limiting it to existing traitors could be skewing the numbers towards just a few people.
var allValidTraitorCandidates = new List<EntityUid>();
if (_traitorRule.CurrentAntagPool != null)
{
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
- id: SleeperAgents
- id: ZombieOutbreak

- type: entityTable
id: SleeperlessAntagEventsTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- id: ClosetSkeleton
- id: DragonSpawn
- id: KingRatMigration
- id: NinjaSpawn
- id: RevenantSpawn
- id: ZombieOutbreak

- type: entity
id: BaseStationEvent
Expand Down
29 changes: 25 additions & 4 deletions Resources/Prototypes/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@

- type: entity
parent: BaseTraitorRuleNoRandomObjectives
id: SpyVsSpy5TC
id: SpyVsSpy3TC
components:
- type: TraitorRule
startingBalance: 5
startingBalance: 3
- type: GameRule
minPlayers: 15
delay:
Expand All @@ -223,6 +223,7 @@
- type: AntagSelection
definitions:
- prefRoles: [ Traitor ]
fallbackRoles: [ TraitorSleeper ]
max: 100
playerRatio: 1
blacklist:
Expand All @@ -243,8 +244,8 @@
- type: GameRule
minPlayers: 15
delay:
min: 240
max: 420
min: 2
max: 4
- type: AntagObjectives
objectives:
- KillRandomTraitorSvSObjective
Expand All @@ -253,6 +254,7 @@
- type: AntagSelection
definitions:
- prefRoles: [ Traitor ]
fallbackRoles: [ TraitorSleeper ]
max: 100
playerRatio: 1
blacklist:
Expand Down Expand Up @@ -345,6 +347,17 @@
- !type:NestedSelector
tableId: CargoGiftsTable

- type: entityTable
id: SleeperlessGameRulesTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
children:
- !type:NestedSelector
tableId: BasicCalmEventsTable
- !type:NestedSelector
tableId: SleeperlessAntagEventsTable
- !type:NestedSelector
tableId: CargoGiftsTable

- type: entityTable
id: SpaceTrafficControlTable
table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
Expand All @@ -364,6 +377,14 @@
scheduledGameRules: !type:NestedSelector
tableId: BasicGameRulesTable

- type: entity
id: SleeperlessStationEventScheduler
parent: BaseGameRule
components:
- type: BasicStationEventScheduler
scheduledGameRules: !type:NestedSelector
tableId: SleeperlessGameRulesTable

- type: entity
id: RampingStationEventScheduler
parent: BaseGameRule
Expand Down
49 changes: 33 additions & 16 deletions Resources/Prototypes/game_presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,41 +159,58 @@
- BasicRoundstartVariation

- type: gamePreset
id: SecretSpyVsSpy #For Admin Use: Runs SpyVsSpy but shows "Secret" in lobby.
id: SpyVsSpy
alias:
- secretsvs
name: secret-title
description: secret-description
showInVote: false #Admin Use
- svs
- theship
name: spy-vs-spy-title
description: spy-vs-spy-description
showInVote: false
rules:
- SpyVsSpy
- BasicStationEventScheduler
- SleeperlessStationEventScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation

- type: gamePreset
id: SpyVsSpy5TC
id: SpyVsSpy3TC
name: spy-vs-spy-title
description: spy-vs-spy-description
showInVote: false
rules:
- SpyVsSpy5TC
- BasicStationEventScheduler
- SpyVsSpy3TC
- SleeperlessStationEventScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation

- type: gamePreset
id: SpyVsSpy
id: SecretSpyVsSpy #For Admin Use: Runs SpyVsSpy but shows "Secret" in lobby.
alias:
- svs
- theship
name: spy-vs-spy-title
description: spy-vs-spy-description
showInVote: false
- secretsvs
name: secret-title
description: secret-description
showInVote: false #Admin Use
rules:
- SpyVsSpy
- BasicStationEventScheduler
- SleeperlessStationEventScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation

- type: gamePreset
id: SecretSpyVsSpy3TC #For Admin Use: Runs SpyVsSpy3TC but shows "Secret" in lobby.
alias:
- secretsvs
name: secret-title
description: secret-description
showInVote: false #Admin Use
rules:
- SpyVsSpy3TC
- SleeperlessStationEventScheduler
- MeteorSwarmScheduler
- SpaceTrafficControlEventScheduler
- BasicRoundstartVariation

- type: gamePreset
Expand Down
7 changes: 4 additions & 3 deletions Resources/Prototypes/secret_weights.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
- type: weightedRandom
id: Secret
weights:
Nukeops: 0.20
Traitor: 0.60
Changeling: 0.20
Nukeops: 0.10
Traitor: 0.50
SpyVsSpy: 0.10
Changeling: 0.10
Zombie: 0.04
Zombieteors: 0.01
Survival: 0.09
Expand Down

0 comments on commit 158b49d

Please sign in to comment.