-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/flesh_cult' into fix_flesh_cult
# Conflicts: # Content.Server/_Sunrise/FleshCult/FleshCultistSystem.cs # Content.Shared/_Sunrise/FleshCult/FleshCultistComponent.cs # Content.Shared/_Sunrise/FleshCult/FleshMobComponent.cs # Resources/Prototypes/_Sunrise/FleshCult/body_mods.yml
- Loading branch information
Showing
227 changed files
with
5,793 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Content.Shared._Sunrise.FleshCult; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Shared.Prototypes; | ||
namespace Content.Client._Sunrise.FleshCult; | ||
|
||
public sealed class FleshCultistSystem : SharedFleshMobSystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<FleshCultistComponent, GetStatusIconsEvent>(GetFleshCultistIcon); | ||
SubscribeLocalEvent<FleshMobComponent, GetStatusIconsEvent>(GetFleshMobIcon); | ||
} | ||
|
||
private void GetFleshCultistIcon(Entity<FleshCultistComponent> ent, ref GetStatusIconsEvent args) | ||
{ | ||
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon); | ||
args.StatusIcons.Add(iconPrototype); | ||
} | ||
|
||
private void GetFleshMobIcon(Entity<FleshMobComponent> ent, ref GetStatusIconsEvent args) | ||
{ | ||
if (HasComp<FleshCultistComponent>(ent)) | ||
return; | ||
|
||
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon); | ||
args.StatusIcons.Add(iconPrototype); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Content.Client/_Sunrise/FleshCult/FleshHeartVisualSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Content.Shared._Sunrise.FleshCult; | ||
using Content.Shared.Flesh; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client._Sunrise.FleshCult; | ||
|
||
public sealed class FleshHeartSystem : VisualizerSystem<FleshHeartComponent> | ||
{ | ||
protected override void OnAppearanceChange(EntityUid uid, FleshHeartComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
if (args.Sprite == null) | ||
return; | ||
|
||
if (!AppearanceSystem.TryGetData<FleshHeartStatus>(uid, FleshHeartVisuals.State, out var state, args.Component)) | ||
return; | ||
var layer = args.Sprite.LayerMapGet(FleshHeartLayers.Base); | ||
|
||
if (state == FleshHeartStatus.Active) | ||
{ | ||
args.Sprite.LayerSetState(layer, component.FinalState); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Content.Server.Flesh; | ||
|
||
namespace Content.Client._Sunrise.FleshCult; | ||
|
||
public sealed class FleshHuggerSystem: SharedFleshHuggerSystem | ||
{ | ||
|
||
public override void Initialize() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Content.Shared._Sunrise.FleshCult; | ||
|
||
namespace Content.Client._Sunrise.FleshCult; | ||
|
||
public sealed class FleshMobSystem : SharedFleshCultistSystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt | ||
|
||
using Content.Shared._Sunrise.Disease; | ||
using Content.Server.Objectives; | ||
using Content.Server.GameTicking; | ||
using Content.Server.GameTicking.Rules; | ||
using Content.Shared.GameTicking.Components; | ||
|
||
namespace Content.Server._Sunrise.Disease; | ||
|
||
public sealed class DiseaseRuleSystem : GameRuleSystem<DiseaseRuleComponent> | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<DiseaseRuleComponent, ObjectivesTextGetInfoEvent>(OnObjectivesTextGetInfo); | ||
} | ||
|
||
private void OnObjectivesTextGetInfo(EntityUid uid, DiseaseRuleComponent comp, ref ObjectivesTextGetInfoEvent args) | ||
{ | ||
args.Minds = comp.DiseasesMinds; | ||
args.AgentName = "разумная болезнь"; | ||
} | ||
|
||
protected override void AppendRoundEndText(EntityUid uid, | ||
DiseaseRuleComponent component, | ||
GameRuleComponent gameRule, | ||
ref RoundEndTextAppendEvent args) | ||
{ | ||
var sick = EntityQueryEnumerator<SickComponent>(); | ||
var immune = EntityQueryEnumerator<DiseaseImmuneComponent>(); | ||
var disease = EntityQueryEnumerator<DiseaseRoleComponent>(); | ||
int infected = 0; | ||
int immuned = 0; | ||
int infects = 0; | ||
while (sick.MoveNext(out _)) | ||
{ | ||
infects++; | ||
} | ||
while (immune.MoveNext(out _)) | ||
{ | ||
immuned++; | ||
} | ||
while (disease.MoveNext(out var comp)) | ||
{ | ||
infected = comp.SickOfAllTime; | ||
} | ||
args.AddLine(Loc.GetString("disease-round-end-result")); | ||
args.AddLine(Loc.GetString("disease-round-end-result-infected", ("count", infected))); | ||
args.AddLine(Loc.GetString("disease-round-end-result-infects", ("count", infects))); | ||
args.AddLine(Loc.GetString("disease-round-end-result-immuned", ("count", immuned))); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Content.Server/_Sunrise/FleshCult/CauseFleshCultInfection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Content.Server.Sunrise.FleshCult; | ||
using Content.Shared.EntityEffects; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server._Sunrise.FleshCult; | ||
|
||
public sealed partial class CauseFleshCultInfection : EntityEffect | ||
{ | ||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
=> Loc.GetString("reagent-effect-guidebook-cause-flesh-cultist-infection", ("chance", Probability)); | ||
|
||
public override void Effect(EntityEffectBaseArgs args) | ||
{ | ||
var entityManager = args.EntityManager; | ||
entityManager.EnsureComponent<PendingFleshCultistComponent>(args.TargetEntity); | ||
} | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
Content.Server/_Sunrise/FleshCult/Events/VentFleshWormsComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Content.Server._Sunrise.FleshCult.Events; | ||
|
||
[RegisterComponent, Access(typeof(VentFleshWormsRule))] | ||
public sealed partial class VentFleshWormsRuleComponent : Component | ||
{ | ||
[DataField("spawnedPrototypeWorm")] | ||
public string SpawnedPrototypeWorm = "MobFleshWorm"; | ||
} |
47 changes: 47 additions & 0 deletions
47
Content.Server/_Sunrise/FleshCult/Events/VentFleshWormsRule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System.Linq; | ||
using Content.Server.Station.Components; | ||
using Content.Server.Station.Systems; | ||
using Content.Server.StationEvents.Components; | ||
using Content.Server.StationEvents.Events; | ||
using Content.Shared.GameTicking.Components; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Server._Sunrise.FleshCult.Events; | ||
|
||
public sealed class VentFleshWormsRule : StationEventSystem<VentFleshWormsRuleComponent> | ||
{ | ||
[Dependency] private readonly StationSystem _stationSystem = default!; | ||
|
||
protected override void Started(EntityUid uid, VentFleshWormsRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) | ||
{ | ||
base.Started(uid, component, gameRule, args); | ||
|
||
var targetStation = _stationSystem.GetStations().FirstOrNull(); | ||
|
||
if (!TryComp(targetStation, out StationDataComponent? data)) | ||
{ | ||
Logger.Info("TargetStation not have StationDataComponent"); | ||
return; | ||
} | ||
|
||
var spawnLocations = EntityManager.EntityQuery<VentCritterSpawnLocationComponent, TransformComponent>().ToList(); | ||
|
||
var grids = data.Grids.ToHashSet(); | ||
spawnLocations.RemoveAll( | ||
backupSpawnLoc => | ||
backupSpawnLoc.Item2.GridUid.HasValue && !grids.Contains(backupSpawnLoc.Item2.GridUid.Value)); | ||
|
||
RobustRandom.Shuffle(spawnLocations); | ||
|
||
var spawnAmount = RobustRandom.Next(10, 20); | ||
Sawmill.Info($"Spawning {spawnAmount} of {component.SpawnedPrototypeWorm}"); | ||
foreach (var location in spawnLocations) | ||
{ | ||
if (spawnAmount-- == 0) | ||
break; | ||
|
||
var coords = Transform(location.Item1.Owner); | ||
Spawn(component.SpawnedPrototypeWorm, coords.Coordinates); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Content.Server/_Sunrise/FleshCult/FleshCultistRoleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Content.Shared.Roles; | ||
|
||
namespace Content.Server._Sunrise.FleshCult; | ||
|
||
[RegisterComponent] | ||
public sealed partial class FleshCultistRoleComponent : BaseMindRoleComponent | ||
{ | ||
[DataField("fleshHearts")] | ||
public int FleshHearts; | ||
} |
Oops, something went wrong.