Skip to content

Commit

Permalink
Game Rule fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirus59 committed Sep 13, 2024
1 parent 35f960b commit c815f98
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
3 changes: 3 additions & 0 deletions Content.Server/Roles/RoleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.SS220.Roles;
using Content.Shared.Roles;
using Content.Shared.SS220.DarkReaper;
using Content.Shared.SS220.MindSlave;
Expand All @@ -24,6 +25,8 @@ public override void Initialize()
SubscribeAntagEvents<MindSlaveRoleComponent>();
//SS220 DarkReaper
SubscribeAntagEvents<DarkReaperRoleComponent>();
//SS220 Spider queen
SubscribeAntagEvents<SpiderQueenRoleComponent>();
}

public string? MindGetBriefing(EntityUid? mindId)
Expand Down
9 changes: 9 additions & 0 deletions Content.Server/SS220/Roles/SpiderQueenRoleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Shared.Roles;

namespace Content.Server.SS220.Roles;

[RegisterComponent, ExclusiveAntagonist]
public sealed partial class SpiderQueenRoleComponent : AntagonistRoleComponent
{
}
6 changes: 0 additions & 6 deletions Content.Server/SS220/SpiderQueen/SpiderQueenRuleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ namespace Content.Server.SS220.SpiderQueen;
[RegisterComponent]
public sealed partial class SpiderQueenRuleComponent : Component
{
/// <summary>
/// ID of the spawner of this antagonist
/// </summary>
[DataField]
public string SpawnerID = "SpawnPointGhostSpaceQueen";

/// <summary>
/// Spawn on a random entity that passed whitelist.
/// If null - spawn on a random tile.
Expand Down
9 changes: 0 additions & 9 deletions Content.Server/SS220/SpiderQueen/SpiderQueenRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,9 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SpiderQueenRuleComponent, AntagSelectEntityEvent>(OnAntagSelectEntity);
SubscribeLocalEvent<SpiderQueenRuleComponent, AntagSelectLocationEvent>(OnAntagSelectLocation);
}

private void OnAntagSelectEntity(Entity<SpiderQueenRuleComponent> ent, ref AntagSelectEntityEvent args)
{
if (args.Handled)
return;

args.Entity = Spawn(ent.Comp.SpawnerID);
}

private void OnAntagSelectLocation(Entity<SpiderQueenRuleComponent> ent, ref AntagSelectLocationEvent args)
{
if (args.Handled)
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/SS220/Antags/spider_queen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: antag
id: SpiderQueen
name: roles-antag-spider-queen-name
antagonist: true
objective: roles-antag-spider-queen-objective
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Used by gamerule
- type: entity
categories: [ HideSpawnMenu, Spawner ]
parent: BaseAntagSpawner
id: SpawnPointGhostSpaceQueen
name: спавнер роли королевы-пауков
Expand All @@ -17,8 +18,6 @@
time: 18000 # 5h
raffle:
settings: default
- type: GhostRoleMobSpawner
prototype: MobSpiderSpaceQueen
- type: Sprite
sprite: Markers/jobs.rsi
layers:
Expand Down
14 changes: 10 additions & 4 deletions Resources/Prototypes/SS220/GameRules/midround_antags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
prototype: DarkReaper
- type: DarkReaperMajorRule

# Spider queen
- type: entity
parent: BaseGameRule
id: SpiderQueenSpawn
Expand All @@ -48,13 +49,18 @@
duration: 1
earliestStart: 45
minimumPlayers: 30
- type: AntagSpawner
prototype: MobSpiderSpaceQueen
- type: AntagSelection
selectionTime: PrePlayerSpawn
definitions:
- max: 1
playerRatio: 10
- prefRoles: [ SpiderQueen ]
spawnerPrototype: SpawnPointGhostSpaceQueen
max: 1
playerRatio: 10
mindComponents:
- type: SpiderQueenRole
prototype: SpiderQueen
- type: SpiderQueenRule
markersWhitelist:
tags:
- SpiderQueenSpawnMarker
- SpiderQueenSpawnMarker

0 comments on commit c815f98

Please sign in to comment.