Skip to content

Commit

Permalink
Фикс генокрадов
Browse files Browse the repository at this point in the history
  • Loading branch information
FaDeOkno committed Apr 1, 2024
1 parent ec983ed commit 7b0494a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Content.Server.Actions;
using Content.Shared.Tag;

namespace Content.Server.GameTicking.Rules;

Expand All @@ -44,6 +45,7 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
[Dependency] private readonly ObjectivesSystem _objectives = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;

private int PlayersPerLing => _cfg.GetCVar(CCVars.ChangelingPlayersPerChangeling);
private int MaxChangelings => _cfg.GetCVar(CCVars.ChangelingMaxChangelings);
Expand Down Expand Up @@ -148,6 +150,12 @@ public bool MakeChangeling(ICommonSession changeling)
return false;
}

if (_tagSystem.HasTag(mind.OwnedEntity.Value, "ChangelingBlacklist")) // Убираю КПБ и новакидов генокрадов
{
Log.Error($"Player {changeling.Name} can't be a changeling.");
return false;
}

var briefing = Loc.GetString("changeling-role-greeting-short", ("character-name", Identity.Entity(entity, EntityManager)));

// Prepare changeling role
Expand Down Expand Up @@ -226,6 +234,8 @@ private void HandleLatejoin(PlayerSpawnCompleteEvent ev)
continue;
if (!job.CanBeAntag)
continue;
if (_tagSystem.HasTag(uid, "ChangelingBlacklist")) // Убираю КПБ и новакидов генокрадов
continue;

// the nth player we adjust our probabilities around
var target = PlayersPerLing * ling.TotalChangelings + 1;
Expand Down Expand Up @@ -293,4 +303,4 @@ private void OnObjectivesTextGetInfo(EntityUid uid, ChangelingRuleComponent comp

return changelings;
}
}
}
6 changes: 6 additions & 0 deletions Resources/Changelog/ChangelogADT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1558,3 +1558,9 @@ Entries:
- { message: "Починка - type: Firestarter", type: Fix}
id: 55716 #костыль отображения в Обновлениях
time: '2024-03-29T08:20:00.0000000+00:00'

- author: Котя
changes:
- { message: "КПБ и новакиды больше не должны становиться генокрадами.", type: Fix}
id: 55717 #костыль отображения в Обновлениях
time: '2024-04-01T08:20:00.0000000+00:00'

0 comments on commit 7b0494a

Please sign in to comment.