Tweaks: разные мелкие исправления и корректировки (#22)
* add: система улучшения зрения для слепых * tweak: повышен урон дробовиков, повышен разброс * tweak: скорость снарядов лазеров увеличена вдвое * fix: фикс отображение веревки крюка-кошки * fix: исправлено отображение воспоминаний * tweak: перевод геймпресета революции * fix: фикс отображения цели и рефактор правила культа * add: Теперь помповые ружья нужно перезаряжать вручную * tweak: повышен урон других снарядов дробовиков * tweak: вещмешок синдиката больше не замедляет * fix: исправлено отображение слота хранилища костюма в инвентаре
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Content.Server.Objectives.Systems;
|
||||
|
||||
namespace Content.Server.Objectives.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(KillCultistTargetConditionSystem))]
|
||||
public sealed partial class KillCultistTargetConditionComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Content.Server.Objectives.Systems;
|
||||
|
||||
namespace Content.Server.Objectives.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(KillPersonConditionSystem))]
|
||||
public sealed partial class PickCultTargetComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server._White.Cult.GameRule;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Roles.Jobs;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Objectives.Conditions;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed partial class KillCultistTarget : IObjectiveCondition
|
||||
{
|
||||
private IEntityManager EntityManager => IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
protected EntityUid? TargetMindId;
|
||||
protected MindComponent? TargetMind => EntityManager.GetComponentOrNull<MindComponent>(TargetMindId);
|
||||
|
||||
protected SharedJobSystem Jobs => EntityManager.System<SharedJobSystem>();
|
||||
|
||||
|
||||
public IObjectiveCondition GetAssigned(EntityUid mindId, MindComponent mind)
|
||||
{
|
||||
var cultistRule = EntityManager.EntityQuery<CultRuleComponent>().FirstOrDefault();
|
||||
Debug.Assert(cultistRule != null, nameof(cultistRule) + " != null");
|
||||
var target = cultistRule.CultTarget;
|
||||
|
||||
return new KillCultistTarget()
|
||||
{
|
||||
TargetMindId = target
|
||||
};
|
||||
}
|
||||
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
var targetName = string.Empty;
|
||||
var jobName = Jobs.MindTryGetJobName(TargetMindId) ?? "Unknown";
|
||||
|
||||
if (TargetMindId == null)
|
||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName), ("job", jobName));
|
||||
|
||||
if (TargetMind?.OwnedEntity is {Valid: true} owned)
|
||||
targetName = EntityManager.GetComponent<MetaDataComponent>(owned).EntityName;
|
||||
|
||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName), ("job", jobName));
|
||||
}
|
||||
}
|
||||
|
||||
public string Description => Loc.GetString("objective-condition-kill-person-description");
|
||||
|
||||
public SpriteSpecifier Icon => new SpriteSpecifier.Rsi(new ("Objects/Weapons/Guns/Pistols/viper.rsi"), "icon");
|
||||
|
||||
public float Progress
|
||||
{
|
||||
get
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<EntityManager>();
|
||||
var mindSystem = entityManager.System<MindSystem>();
|
||||
return TargetMindId == null || TargetMind == null || mindSystem.IsCharacterDeadIc(TargetMind!) ? 1f : 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public float Difficulty => 2f;
|
||||
|
||||
public bool Equals(IObjectiveCondition? other)
|
||||
{
|
||||
return other is KillCultistTarget kpc && Equals(TargetMindId, kpc.TargetMindId);
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
|
||||
return obj.GetType() == GetType() && Equals((KillCultistTarget) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return TargetMindId?.GetHashCode() ?? 0;
|
||||
}
|
||||
}*/
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Content.Server.Objectives.Components;
|
||||
using Content.Server._White.Cult.GameRule;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Objectives.Components;
|
||||
|
||||
namespace Content.Server.Objectives.Systems;
|
||||
|
||||
public sealed class KillCultistTargetConditionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||
[Dependency] private readonly TargetObjectiveSystem _target = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<KillCultistTargetConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
|
||||
|
||||
SubscribeLocalEvent<KillCultistTargetConditionComponent, ObjectiveAssignedEvent>(OnPersonAssigned);
|
||||
}
|
||||
|
||||
private void OnGetProgress(EntityUid uid, KillCultistTargetConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
||||
{
|
||||
if (!_target.GetTarget(uid, out var target))
|
||||
return;
|
||||
|
||||
args.Progress = GetProgress(target.Value);
|
||||
}
|
||||
|
||||
private void OnPersonAssigned(EntityUid uid, KillCultistTargetConditionComponent component, ref ObjectiveAssignedEvent args)
|
||||
{
|
||||
if (!TryComp<TargetObjectiveComponent>(uid, out var target))
|
||||
{
|
||||
args.Cancelled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// target already assigned
|
||||
if (target.Target != null)
|
||||
return;
|
||||
|
||||
var cultistRule = EntityManager.EntityQuery<CultRuleComponent>().FirstOrDefault();
|
||||
Debug.Assert(cultistRule != null, nameof(cultistRule) + " != null");
|
||||
var cultTarget = cultistRule.CultTarget;
|
||||
|
||||
if (cultTarget != null)
|
||||
_target.SetTarget(uid, cultTarget.Value, target);
|
||||
}
|
||||
|
||||
private float GetProgress(EntityUid target)
|
||||
{
|
||||
// deleted or gibbed or something, counts as dead
|
||||
if (!TryComp<MindComponent>(target, out var mind) || mind.OwnedEntity == null)
|
||||
return 1f;
|
||||
|
||||
// dead is success
|
||||
return _mind.IsCharacterDeadIc(mind) ? 1f : 0f;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server._White.Cult.GameRule;
|
||||
using Content.Server.Objectives.Components;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Shared.CCVar;
|
||||
@@ -30,6 +32,8 @@ public sealed class KillPersonConditionSystem : EntitySystem
|
||||
SubscribeLocalEvent<PickRandomPersonComponent, ObjectiveAssignedEvent>(OnPersonAssigned);
|
||||
|
||||
SubscribeLocalEvent<PickRandomHeadComponent, ObjectiveAssignedEvent>(OnHeadAssigned);
|
||||
|
||||
SubscribeLocalEvent<PickCultTargetComponent, ObjectiveAssignedEvent>(OnCultTargetAssigned);
|
||||
}
|
||||
|
||||
private void OnGetProgress(EntityUid uid, KillPersonConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
||||
@@ -99,6 +103,28 @@ public sealed class KillPersonConditionSystem : EntitySystem
|
||||
_target.SetTarget(uid, _random.Pick(allHeads), target);
|
||||
}
|
||||
|
||||
private void OnCultTargetAssigned(Entity<PickCultTargetComponent> ent, ref ObjectiveAssignedEvent args)
|
||||
{
|
||||
// invalid prototype
|
||||
if (!TryComp<TargetObjectiveComponent>(ent.Owner, out var target))
|
||||
{
|
||||
args.Cancelled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// target already assigned
|
||||
if (target.Target != null)
|
||||
return;
|
||||
|
||||
var cultistRule = EntityManager.EntityQuery<CultRuleComponent>().FirstOrDefault();
|
||||
if (cultistRule?.CultTarget is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_target.SetTarget(ent.Owner, cultistRule.CultTarget.Value);
|
||||
}
|
||||
|
||||
private float GetProgress(EntityUid target, bool requireDead)
|
||||
{
|
||||
// deleted or gibbed or something, counts as dead
|
||||
|
||||
Reference in New Issue
Block a user