Skip to content

Commit

Permalink
ещё всякая хрень
Browse files Browse the repository at this point in the history
  • Loading branch information
Lgibb18 committed Aug 12, 2024
1 parent 45089d0 commit f3642ad
Show file tree
Hide file tree
Showing 26 changed files with 98 additions and 50 deletions.
6 changes: 3 additions & 3 deletions Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Content.Shared.Humanoid;
using Content.Shared.Ligyb;
namespace Content.Client.Ligyb;
using Content.Shared._Sunrise.Disease;
namespace Content.Client._Sunrise.Disease;

public sealed class DiseaseRoleSystem : EntitySystem
{
Expand All @@ -24,7 +24,7 @@ private void OnInfect(ClientInfectEvent ev)
var sick = EnsureComp<SickComponent>(target);
sick.owner = performer;
sick.Inited = true;
if(TryComp<DiseaseRoleComponent>(performer, out var comp))
if (TryComp<DiseaseRoleComponent>(performer, out var comp))
{
comp.Infected.Add(target);
}
Expand Down
7 changes: 4 additions & 3 deletions Content.Client/_Sunrise/Disease/SickSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using Content.Shared.StatusIcon.Components;
using Robust.Client.Player;
using Robust.Shared.Prototypes;
using Content.Shared.Ligyb;
namespace Content.Client.Ligyb;
using Content.Shared._Sunrise.Disease;
using Content.Shared.Ghost;
namespace Content.Client._Sunrise.Disease;
public sealed class SickSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
Expand All @@ -32,7 +33,7 @@ private void OnGetStatusIcon(EntityUid uid, SickComponent component, ref GetStat
{
if (_playerManager.LocalEntity != null)
{
if (HasComp<DiseaseRoleComponent>(_playerManager.LocalEntity.Value))
if (HasComp<DiseaseRoleComponent>(_playerManager.LocalEntity.Value) || HasComp<GhostComponent>(_playerManager.LocalEntity.Value))
{
if (!_mobState.IsDead(uid) &&
!HasComp<ActiveNPCComponent>(uid) &&
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// © 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.Chemistry.Reagent;
using Robust.Shared.Prototypes;
using Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
using Content.Shared.EntityEffects;
public sealed partial class CureDiseaseInfection : EntityEffect
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// © 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.Clothing.Components;
using Content.Shared.Inventory.Events;
using Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
using Content.Shared.Examine;
using Content.Shared.Verbs;
using Robust.Shared.Utility;
namespace Content.Server.Ligyb;
namespace Content.Server._Sunrise.Disease;

public sealed class DiseaseImmuneClothingSystem : EntitySystem
{
Expand Down Expand Up @@ -49,7 +49,7 @@ private void OnArmorVerbExamine(EntityUid uid, DiseaseImmuneClothingComponent co
return;

var examineMarkup = new FormattedMessage();
examineMarkup.TryAddMarkup($"Защищает от заражения на {Convert.ToInt32(component.Prob*100)}%", out var _);
examineMarkup.TryAddMarkup($"Защищает от заражения на {Convert.ToInt32(component.Prob * 100)}%", out var _);

_examine.AddDetailedExamineVerb(args, component, examineMarkup,
"Стерильность", "/Textures/Interface/VerbIcons/dot.svg.192dpi.png",
Expand Down
21 changes: 17 additions & 4 deletions Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// © 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.Actions;
using Robust.Shared.Random;
using Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
using Content.Server.Store.Components;
using Content.Server.Store.Systems;
using Robust.Shared.Prototypes;
using Content.Shared.FixedPoint;
using Content.Shared.Popups;
using Content.Shared.Store.Components;
namespace Content.Server.Ligyb;
using Content.Server.Objectives;
using Content.Server.Objectives.Components;
using Content.Server.Objectives.Systems;
namespace Content.Server._Sunrise.Disease;

public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem
{
Expand All @@ -34,6 +37,13 @@ public override void Initialize()
SubscribeLocalEvent<DiseaseRoleComponent, DiseaseAddCoughChanceEvent>(OnCoughChance);
SubscribeLocalEvent<DiseaseRoleComponent, DiseaseAddLethalEvent>(OnLethal);
SubscribeLocalEvent<DiseaseRoleComponent, DiseaseAddShieldEvent>(OnShield);
SubscribeLocalEvent<DiseaseRuleComponent, ObjectivesTextGetInfoEvent>(OnObjectivesTextGetInfo);
}

private void OnObjectivesTextGetInfo(EntityUid uid, DiseaseRuleComponent comp, ref ObjectivesTextGetInfoEvent args)
{
args.Minds = comp.DiseasesMinds;
args.AgentName = "разумная болезнь";
}


Expand Down Expand Up @@ -129,7 +139,7 @@ private void OnInit(EntityUid uid, DiseaseRoleComponent component, ComponentInit

private void OnMapInit(EntityUid uid, DiseaseRoleComponent component, MapInitEvent args)
{
_actionsSystem.AddAction(uid, DiseaseShopId);
_actionsSystem.AddAction(uid, DiseaseShopId, uid);
}

private void OnShop(EntityUid uid, DiseaseRoleComponent component, DiseaseShopActionEvent args)
Expand Down Expand Up @@ -180,7 +190,10 @@ bool TryRemoveMoney(EntityUid uid, FixedPoint2 value)

private void OnAddSymptom(EntityUid uid, DiseaseRoleComponent component, DiseaseAddSymptomEvent args)
{
component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel));
if (!component.Symptoms.ContainsKey(args.Symptom))
{
component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel));
}
_actionsSystem.RemoveAction(uid, args.Action);
}

Expand Down
7 changes: 7 additions & 0 deletions Content.Server/_Sunrise/Disease/DiseaseRuleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server._Sunrise.Disease;

[RegisterComponent, Access(typeof(DiseaseRoleSystem))]
public sealed partial class DiseaseRuleComponent : Component
{
public List<(EntityUid, string)> DiseasesMinds = new();
}
2 changes: 1 addition & 1 deletion Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Ligyb;
namespace Content.Server._Sunrise.Disease;

[RegisterComponent]
public sealed partial class MinimumBleedComponent : Component
Expand Down
6 changes: 3 additions & 3 deletions Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
using Robust.Shared.Configuration;
namespace Content.Server.Ligyb;
namespace Content.Server._Sunrise.Disease;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Server.Body.Components;
Expand Down Expand Up @@ -30,9 +30,9 @@ public override void Update(float frameTime)
var query = EntityQueryEnumerator<MinimumBleedComponent>();
while (query.MoveNext(out var uid, out var component))
{
if(TryComp<BloodstreamComponent>(uid, out var blood))
if (TryComp<BloodstreamComponent>(uid, out var blood))
{
if(blood.BleedAmount < component.MinValue)
if (blood.BleedAmount < component.MinValue)
{
_bloodstream.TryModifyBleedAmount(uid, component.MinValue, blood);
}
Expand Down
35 changes: 22 additions & 13 deletions Content.Server/_Sunrise/Disease/SickSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
using System.Numerics;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
Expand Down Expand Up @@ -29,7 +29,7 @@
using Content.Shared.Item;
using Content.Shared.Speech.Muting;
using Content.Shared.Store.Components;
namespace Content.Server.Ligyb;
namespace Content.Server._Sunrise.Disease;
public sealed class SickSystem : SharedSickSystem
{
[Dependency] private readonly AutoEmoteSystem _autoEmote = default!;
Expand All @@ -43,6 +43,7 @@ public sealed class SickSystem : SharedSickSystem
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedStunSystem _stun = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
private EntityLookupSystem _lookup => _entityManager.System<EntityLookupSystem>();
public override void Initialize()
{
Expand Down Expand Up @@ -227,7 +228,7 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args
{
if (args.Handled)
return;
args.Handled = true;
if (!component.Symptoms.Contains(args.Emote.ID)) return;
switch (args.Emote.ID)
{
case "Headache":
Expand All @@ -243,26 +244,34 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args
{
_damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.25f * disease.Lethal), true, origin: uid);
}
}
EntityCoordinates start = Transform(uid).Coordinates;
foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f))
{
if (HasComp<HumanoidAppearanceComponent>(entity) && !HasComp<SickComponent>(entity) && !HasComp<DiseaseImmuneComponent>(entity))

foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f))
{
OnInfected(entity, component.owner, Comp<DiseaseRoleComponent>(component.owner).CoughInfectChance);
if (_robustRandom.Prob(disease.CoughInfectChance))
{
if (HasComp<HumanoidAppearanceComponent>(entity) && !HasComp<SickComponent>(entity) && !HasComp<DiseaseImmuneComponent>(entity))
{
OnInfected(entity, component.owner, Comp<DiseaseRoleComponent>(component.owner).CoughInfectChance);
}
}
}
}
}
break;
case "Sneeze":
if (_robustRandom.Prob(0.9f))
{
EntityCoordinates start = Transform(uid).Coordinates;
foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f))
if (TryComp<DiseaseRoleComponent>(component.owner, out var disease))
{
if (HasComp<HumanoidAppearanceComponent>(entity) && !HasComp<SickComponent>(entity) && !HasComp<DiseaseImmuneComponent>(entity))
foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f))
{
OnInfected(entity, component.owner, Comp<DiseaseRoleComponent>(component.owner).CoughInfectChance);
if (_robustRandom.Prob(disease.CoughInfectChance))
{
if (HasComp<HumanoidAppearanceComponent>(entity) && !HasComp<SickComponent>(entity) && !HasComp<DiseaseImmuneComponent>(entity))
{
OnInfected(entity, component.owner, Comp<DiseaseRoleComponent>(component.owner).CoughInfectChance);
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class DiseaseImmuneClothingComponent : Component
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class DiseaseImmuneComponent : Component
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Store;
using Content.Shared.Chemistry.Reagent;
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class DiseaseRoleComponent : Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class DiseaseTempImmuneComponent : Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class DiseaseVaccineTimerComponent : Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;
using Robust.Shared.Timing;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/_Sunrise/Disease/InfectEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Content.Shared.Actions;
using Robust.Shared.Serialization;
using Content.Shared.Inventory;
namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

public sealed partial class InfectEvent : EntityTargetActionEvent
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Robust.Shared.Random;
using Content.Shared.Humanoid;

namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

public abstract class SharedDiseaseRoleSystem : EntitySystem
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/_Sunrise/Disease/SharedSickSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Content.Shared.Ligyb;
namespace Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
namespace Content.Shared._Sunrise.Disease;
using Content.Shared.Drunk;
using Content.Shared.StatusEffect;
using Robust.Shared.Enums;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Shared.Ligyb;
using Content.Shared._Sunrise.Disease;
using Robust.Shared.Random;
public abstract class SharedSickSystem : EntitySystem
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/_Sunrise/Disease/SickComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Shared.Ligyb;
namespace Content.Shared._Sunrise.Disease;

[RegisterComponent]
public sealed partial class SickComponent : Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mob-name-disease = разумный вирус
mob-name-disease = Разумная болезнь
mob-description-disease = plague inc 2.0
ghostrole-disease-name = разумный вирус
ghostrole-disease-description = Обычный вирус, который вдруг решил стать разумным. С кем не бывает?
ghostrole-disease-name = разумная болезнь
ghostrole-disease-description = Обычная болезнь, которая вдруг решила стать разумной. С кем не бывает?
action-disease-infect-name = Заразить [10 ОЭ]
action-disease-infect-description = Попытка заразить существо [-10 очков эволюции]. Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить.
action-disease-shop-name = Мутация
Expand Down
File renamed without changes.
13 changes: 11 additions & 2 deletions Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- type: entity
id: MobDisease
name: Разумный вирус
name: разумная болезнь
description: plague inc 2.0
components:
- type: MindContainer
Expand Down Expand Up @@ -49,9 +49,18 @@
makeSentient: true
name: ghostrole-disease-name
description: ghostrole-disease-description
requirements:
- !type:DepartmentTimeRequirement
department: Medical
time: 7200 #2 hrs
- !type:OverallPlaytimeRequirement
time: 18000 #5 hrs
raffle:
settings: default

- type: GhostTakeoverAvailable
- type: PointLight
color: "#3A6041"
color: "#52964F"
radius: 2
softness: 1
- type: UserInterface
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
raiseProductEventOnUser: true
productAction: ActionDiseaseCough
cost:
DiseasePoints: 15
DiseasePoints: 0
categories:
- DiseaseInfectCategory
conditions:
Expand Down
5 changes: 4 additions & 1 deletion Resources/Prototypes/_Sunrise/Disease/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
components:
- type: StationEvent
minimumPlayers: 40
weight: 10
weight: 5
duration: 1
earliestStart: 30
reoccurrenceDelay: 20
- type: LateJoinSpawnRule
prototype: MobDisease

6 changes: 6 additions & 0 deletions Resources/Prototypes/_Sunrise/Disease/roundstart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: entity
id: DiseaseRule
parent: BaseGameRule
categories: [ HideSpawnMenu ]
components:
- type: DiseaseRule

0 comments on commit f3642ad

Please sign in to comment.